This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log('Hello LabJack') | |
| var ljn = require('labjack-nodejs'); | |
| var NanoTimer = require('nanotimer') | |
| var fs = require('fs') | |
| var now = require('performance-now') | |
| var path = require('path') | |
| var mkdirp = require('mkdirp').mkdirp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gym | |
| from gym import wrappers | |
| env = gym.make('CartPole-v0') | |
| env = wrappers.Monitor(env, './tmp/cartpole-experiment-1') | |
| for i_episode in range(20): | |
| observation = env.reset() | |
| for t in range(100): | |
| env.render() | |
| action = env.action_space.sample() | |
| observation, reward, done, info = env.step(action) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def align_shapes(self, index=True, axis=0, location=1, to_canvas=False): | |
| """Aligns selected shapes either in horizontal or vertical axis to | |
| the left, center, right, or top, center, bottom. If to_canvas is True | |
| then it aligns to the canvas. | |
| Parameters | |
| ---------- | |
| index : bool, list, int | |
| index of objects to be selected. Where True corresponds to all | |
| objects, a list of integers to a list of objects, and a single | |
| integer to that particular object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is in interactive test | |
| from time import sleep | |
| import threading | |
| from napari.components import Dims | |
| from napari.components._dims._constants import DimsMode | |
| from napari.components._dims.view import QtDims | |
| from napari.util import app_context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from skimage import data | |
| from skimage.color import rgb2gray | |
| from napari import Viewer | |
| from napari.util import app_context | |
| # THIS WILL NOT WORK UNTIL THERE IS SEPARATION BETWEEN MODEL AND VIEW! | |
| def test_dims_and_ranges(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Interactive test for range slider. | |
| """ | |
| # starts the QT event loop | |
| from napari._qt.range_slider.range_slider import QVRangeSlider | |
| from napari.util import app_context | |
| with app_context(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _get_viewer_thumbnail(self): | |
| """Creat an overall thumbnail based on the layer thumbnails.""" | |
| thumbnail = np.zeros(layers.Layer._thumbnail_shape, dtype=np.uint8) | |
| for layer in self.layers[::-1]: | |
| if layer.blending == 'translucent': | |
| f_dest = thumbnail[..., 3][..., None] / 255 | |
| f_source = 1 - layer.thumbnail[..., 3][..., None] / 255 | |
| elif layer.blending == 'additive': | |
| f_dest = thumbnail[..., 3][..., None] / 255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate_3D_path_meshes_2D(path, p=(0, 0, 1)): | |
| """Generates list of mesh vertices and triangles from a path | |
| Parameters | |
| ---------- | |
| path : (N, D) array | |
| Vertices specifying the path where D is 2 or 3. | |
| p : 3-tuple, optional | |
| orthogonal vector for segment calculation in 3D. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.