Skip to content

Commit

Permalink
[DATALAD RUNCMD] run codespell throughout fixing typo automagically
Browse files Browse the repository at this point in the history
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
  • Loading branch information
yarikoptic committed Nov 28, 2023
1 parent c2698a0 commit a83e15d
Show file tree
Hide file tree
Showing 34 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Github has made it easy to separate issues from discussions. Generally speaking,
* Optionally assign a reviewer on the right of the screen - otherwise a member of the SLEAP developer team will self-assign themselves.
8) If the reviewer requests changes, repeat steps 3-5 and `Re-request review`.
9) Once the reviewer signs off they will squash + merge the PR into the `develop` branch.
* New feautures will be available on the `main` branch when a new release of SLEAP is released.
* New features will be available on the `main` branch when a new release of SLEAP is released.

## Style Guides

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ optional arguments:
Path to output directory where the frozen model will be exported to.
Defaults to a folder named 'exported_model'.
-r, --ragged RAGGED
Keep tensors ragged if present. If ommited, convert
Keep tensors ragged if present. If omitted, convert
ragged tensors into regular tensors with NaN padding.
-n, --max_instances MAX_INSTANCES
Limit maximum number of instances in multi-instance models.
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Note that many of the menu command have keyboard shortcuts which can be configur

"**Evaluate Metrics for Trained Models...**" provides you with information to evaluate all of your trained models. For example, you can see the recall and precision of predictions on frames with ground truth validation data (i.e., data withheld when training).

"**Visualize Model Outputs...**" allows you to select a trained model and see the intermediate inference data plotted on the frame image. In particular, looking at the confidence maps used to predict each node can be helpful for understanding why and where your model isn't preforming well.
"**Visualize Model Outputs...**" allows you to select a trained model and see the intermediate inference data plotted on the frame image. In particular, looking at the confidence maps used to predict each node can be helpful for understanding why and where your model isn't performing well.

"**Add Instances from All Predictions on Current Frame**" converts ever predicted instance on the current frame into a user editable instance (which allows you to make corrections and/or use it for training).

Expand Down
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Although you do not need Mambaforge installed to perform a `pip install`, we rec
The pypi distributed package of SLEAP ships with the following extras:
- **pypi**: For installation without an mamba environment file. All dependencies come from PyPI.
- **jupyter**: This installs all *pypi* and jupyter lab dependencies.
- **dev**: This installs all *jupyter* dependencies and developement tools for testing and building docs.
- **dev**: This installs all *jupyter* dependencies and development tools for testing and building docs.
- **conda_jupyter**: For installation using a mamba environment file included in the source code. Most dependencies are listed as conda packages in the environment file and only a few come from PyPI to allow jupyter lab support.
- **conda_dev**: For installation using [a mamba environment](https://github.com/search?q=repo%3Atalmolab%2Fsleap+path%3Aenvironment*.yml&type=code) with a few PyPI dependencies for development tools.
```
Expand Down Expand Up @@ -315,11 +315,11 @@ python -c "import sleap; sleap.system_summary()"
GPUs: 2/2 available
Device: /physical_device:GPU:0
Available: True
Initalized: False
Initialized: False
Memory growth: None
Device: /physical_device:GPU:1
Available: True
Initalized: False
Initialized: False
Memory growth: None

SLEAP uses TensorFlow for GPU acceleration. To directly check if TensorFlow is detecting your GPUs:
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/Interactive_and_realtime_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"GPUs: 1/1 available\n",
" Device: /physical_device:GPU:0\n",
" Available: True\n",
" Initalized: False\n",
" Initialized: False\n",
" Memory growth: True\n"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/Interactive_and_resumable_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"GPUs: 1/1 available\n",
" Device: /physical_device:GPU:0\n",
" Available: True\n",
" Initalized: False\n",
" Initialized: False\n",
" Memory growth: None\n"
]
}
Expand Down Expand Up @@ -207,7 +207,7 @@
"cfg.data.labels.training_labels = TRAINING_SLP_FILE\n",
"cfg.data.labels.validation_fraction = 0.1\n",
"\n",
"# Preprocesssing and training parameters.\n",
"# Preprocessing and training parameters.\n",
"cfg.data.instance_cropping.center_on_part = \"thorax\"\n",
"cfg.optimization.augmentation_config.rotate = True\n",
"cfg.optimization.epochs = 10 # This is the maximum number of training rounds.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
"GPUs: 1/1 available\n",
" Device: /physical_device:GPU:0\n",
" Available: True\n",
" Initalized: False\n",
" Initialized: False\n",
" Memory growth: True\n",
"INFO:sleap.nn.training:\n",
"INFO:sleap.nn.training:Initializing trainer...\n",
Expand Down Expand Up @@ -768,7 +768,7 @@
"GPUs: 1/1 available\n",
" Device: /physical_device:GPU:0\n",
" Available: True\n",
" Initalized: False\n",
" Initialized: False\n",
" Memory growth: True\n",
"INFO:sleap.nn.training:\n",
"INFO:sleap.nn.training:Initializing trainer...\n",
Expand Down Expand Up @@ -1052,7 +1052,7 @@
"GPUs: 1/1 available\n",
" Device: /physical_device:GPU:0\n",
" Available: True\n",
" Initalized: False\n",
" Initialized: False\n",
" Memory growth: True\n",
"\n",
"Video: dataset/drosophila-melanogaster-courtship/20190128_113421.mp4\n",
Expand Down
2 changes: 1 addition & 1 deletion pypi_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# setup.py, the packages in requirements.txt will also be installed when running
# pip install sleap[pypi].

# These are also distrubuted through conda and not pip installed when using conda.
# These are also distributed through conda and not pip installed when using conda.
attrs>=21.2.0,<=21.4.0
cattrs==1.1.1
# certifi>=2017.4.17,<=2021.10.8
Expand Down
2 changes: 1 addition & 1 deletion sleap/config/training_editor_form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ augmentation:
name: optimization.augmentation_config.gaussian_noise_stddev
type: double
- default: false
help: If True, gamma constrast adjustment will be applied to the image. This scales
help: If True, gamma contrast adjustment will be applied to the image. This scales
all pixel values by `x ** gamma` where `x` is the pixel value in the [0, 1] range.
Values in [0, 255] are first scaled to [0, 1]. See `imgaug.augmenters.contrast.GammaContrast`.
label: Contrast
Expand Down
4 changes: 2 additions & 2 deletions sleap/gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def __init__(
self._initialize_gui()

if reset:
print("Reseting GUI state and preferences...")
print("Resetting GUI state and preferences...")
prefs.reset_to_default()
elif len(prefs["window state"]) > 0:
print("Restoring GUI state...")
Expand Down Expand Up @@ -1481,7 +1481,7 @@ def _show_learning_dialog(self, mode: str):
return

if self._child_windows.get(mode, None) is None:
# Re-use existing dialog widget.
# Reuse existing dialog widget.
self._child_windows[mode] = LearningDialog(
mode,
self.state["filename"],
Expand Down
4 changes: 2 additions & 2 deletions sleap/gui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def _try_save(context, labels: Labels, filename: str):

except Exception as e:
message = (
f"An error occured when attempting to save:\n {e}\n\n"
f"An error occurred when attempting to save:\n {e}\n\n"
"Try saving your project with a different filename or in a different "
"format."
)
Expand Down Expand Up @@ -2068,7 +2068,7 @@ def try_and_skip_if_error(func, *args, **kwargs):
etype=type(e), value=e, tb=e.__traceback__
)
logger.warning(
f"Recieved the following error while replacing skeleton:\n"
f"Received the following error while replacing skeleton:\n"
f"{''.join(tb_str)}"
)

Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/learning/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def update_loaded_config(
editor GUI tab.
Returns:
A `ScopedKeyDict` with the loaded config values overriden by the corresponding
A `ScopedKeyDict` with the loaded config values overridden by the corresponding
ones from the `tab_cfg_key_val_dict`.
"""
# Serialize training config
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/learning/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ def waiting_item(**kwargs):
if gui:
QtWidgets.QMessageBox(
text=(
"An error occcured during inference. Your command line "
"An error occurred during inference. Your command line "
"terminal may have more information about the error."
)
).exec_()
Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/overlays/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TrackTrailOverlay(BaseOverlay):
max_node_count: Optional[int] = None

def __attrs_post_init__(self):
"""Initialize the shade options attribute after initalizing the instance."""
"""Initialize the shade options attribute after initializing the instance."""

self.shade_options = self.get_shade_options()

Expand Down
4 changes: 2 additions & 2 deletions sleap/gui/widgets/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,11 +1172,11 @@ def wheelEvent(self, event):
pass

def keyPressEvent(self, event):
"""Custom event hander, disables default QGraphicsView behavior."""
"""Custom event handler, disables default QGraphicsView behavior."""
event.ignore() # Kicks the event up to parent

def keyReleaseEvent(self, event):
"""Custom event hander, disables default QGraphicsView behavior."""
"""Custom event handler, disables default QGraphicsView behavior."""
event.ignore() # Kicks the event up to parent


Expand Down
2 changes: 1 addition & 1 deletion sleap/gui/widgets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def toggle_button_callback(self, checked: bool):
for child in self.content_area.findChildren(QWidget):
child.setVisible(checked)

# Collapse combo box (otherwise, visiblity opens combo)
# Collapse combo box (otherwise, visibility opens combo)
if checked:
combo = self.content_area.findChild(QComboBox)
combo.hidePopup()
Expand Down
10 changes: 5 additions & 5 deletions sleap/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* `Instance` (`PredictedInstance`) can be associated with a `Track`
* A `PointArray` (or `PredictedPointArray`) contains zero or more
`Point` objects (or `PredictedPoint` objectss), ideally as many as
`Point` objects (or `PredictedPoint` objects), ideally as many as
there are in the associated :class:`Skeleton` although these can get
out of sync if the skeleton is manipulated.
"""
Expand Down Expand Up @@ -91,7 +91,7 @@ def numpy() -> np.ndarray:


# This turns PredictedPoint into an attrs class. Defines comparators for
# us and generaly makes it behave better. Crazy that this works!
# us and generally makes it behave better. Crazy that this works!
Point = attr.s(these={name: attr.ib() for name in Point.dtype.names}, init=False)(Point)


Expand Down Expand Up @@ -157,7 +157,7 @@ def from_point(cls, point: Point, score: float = 0.0) -> "PredictedPoint":


# This turns PredictedPoint into an attrs class. Defines comparators for
# us and generaly makes it behave better. Crazy that this works!
# us and generally makes it behave better. Crazy that this works!
PredictedPoint = attr.s(
these={name: attr.ib() for name in PredictedPoint.dtype.names}, init=False
)(PredictedPoint)
Expand Down Expand Up @@ -212,7 +212,7 @@ def __array_finalize__(self, obj):
"""
Override :method:`np.recarray.__array_finalize__()`.
Overide __array_finalize__ on recarray because it converting the
Override __array_finalize__ on recarray because it converting the
dtype of any np.void subclass to np.record, we don't want this.
"""
pass
Expand Down Expand Up @@ -1191,7 +1191,7 @@ def make_instance_cattr() -> cattr.Converter:

#### UNSTRUCTURE HOOKS

# JSON dump cant handle NumPy bools so convert them. These are present
# JSON dump can't handle NumPy bools so convert them. These are present
# in Point/PredictedPoint objects now since they are actually custom numpy dtypes.
converter.register_unstructure_hook(np.bool_, bool)

Expand Down
4 changes: 2 additions & 2 deletions sleap/io/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ def to_dict(self, skip_labels: bool = False) -> Dict[str, Any]:
skip_labels: If True, skip labels serialization and just do the metadata.
Returns:
A dict containing the followings top level keys:
A dict containing the following top level keys:
* version - The version of the dict/json serialization format.
* skeletons - The skeletons associated with these underlying
instances.
Expand Down Expand Up @@ -2621,7 +2621,7 @@ def video_callback(
Args:
video_list: A list of serialized `Video` objects stored as nested
dictionaries.
new_paths: A list of paths where we'll autimatically try to find the
new_paths: A list of paths where we'll automatically try to find the
missing videos.
context: A dictionary containing a "changed_on_load" key with a boolean
value. Used externally to determine if any filenames were updated.
Expand Down
6 changes: 3 additions & 3 deletions sleap/io/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def matches(self, other):
Check if attributes match.
Args:
other: The instance to comapare with.
other: The instance to compare with.
Returns:
True if attributes match, False otherwise
Expand Down Expand Up @@ -1537,7 +1537,7 @@ def make_specific_backend(backend_class, kwargs):

@staticmethod
def cattr():
"""Return a cattr converter for serialiazing/deserializing Video objects.
"""Return a cattr converter for serializing/deserializing Video objects.
Returns:
A cattr converter.
Expand Down Expand Up @@ -1605,7 +1605,7 @@ def fixup_path(
elif os.path.exists(os.path.basename(path)):
return os.path.basename(path)

# Special case: this is an ImgStore path! We cant use
# Special case: this is an ImgStore path! We can't use
# basename because it will strip the directory name off
elif path.endswith("metadata.yaml"):

Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/architectures/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def backbone_fn(x: tf.Tensor, current_stride: int) -> tf.Tensor:
def tile_channels(X: tf.Tensor) -> tf.Tensor:
"""Tile single channel to 3 channel tensor.
This functon is useful to replicate grayscale single-channel images into 3-channel
This function is useful to replicate grayscale single-channel images into 3-channel
monochrome RGB images.
Args:
Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/config/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AugmentationConfig:
See `imgaug.augmenters.arithmetic.AdditiveGaussianNoise`.
gaussian_noise_mean: Mean of the distribution to sample from.
gaussian_noise_stddev: Standard deviation of the distribution to sample from.
contrast: If True, gamma constrast adjustment will be applied to the image.
contrast: If True, gamma contrast adjustment will be applied to the image.
This scales all pixel values by `x ** gamma` where `x` is the pixel value in
the [0, 1] range. Values in [0, 255] are first scaled to [0, 1]. See
`imgaug.augmenters.contrast.GammaContrast`.
Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/data/resizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def transform_dataset(self, ds_input: tf.data.Dataset) -> tf.data.Dataset:
A `tf.data.Dataset` with elements containing the same images and points with
resizing applied.
The "scale" key of the example will be multipled by the `scale` attribute of
The "scale" key of the example will be multiplied by the `scale` attribute of
this transformer.
If the `keep_full_image` attribute is True, a key specified by
Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4976,7 +4976,7 @@ def _make_export_cli_parser() -> argparse.ArgumentParser:
action="store_true",
default=False,
help=(
"Keep tensors ragged if present. If ommited, convert ragged tensors"
"Keep tensors ragged if present. If omitted, convert ragged tensors"
" into regular tensors with NaN padding."
),
)
Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/paf_grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def score_paf_lines(
Args:
paf_lines_sample: The PAF vectors evaluated at the lines formed between
candidate conncetions as a `tf.Tensor` of shape
candidate connections as a `tf.Tensor` of shape
`(n_candidates, n_line_points, 2, 3)` dtype `tf.int32`. This can be
generated by `get_paf_lines()`.
peaks_sample: The detected peaks in a sample as a `tf.Tensor` of shape
Expand Down
2 changes: 1 addition & 1 deletion sleap/nn/peak_finding.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def find_global_peaks_rough(
def find_local_peaks_rough(
cms: tf.Tensor, threshold: float = 0.2
) -> Tuple[tf.Tensor, tf.Tensor, tf.Tensor, tf.Tensor]:
"""Find local maxima via non-maximum suppresion.
"""Find local maxima via non-maximum suppression.
Args:
cms: Tensor of shape (samples, height, width, channels).
Expand Down
4 changes: 2 additions & 2 deletions sleap/nn/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def add_frame_instances(
# Which frames are "good"? First, we'll see if the best track match
# for each of the instances was distinct—i.e., no competition for
# matching any track. Second, we'll make sure that there are enough
# "usuable" instances—i.e., instances with the nodes that we'll track
# "usable" instances—i.e., instances with the nodes that we'll track
# using Kalman filters.
elif frame_match.has_only_first_choice_matches:

Expand Down Expand Up @@ -1342,7 +1342,7 @@ def track(
# print(f"Kalman filters initialized (frame {t})")

# Clear the data used to init filters, so that if the filters
# stop tracking and we need to re-init, we won't re-use the
# stop tracking and we need to re-init, we won't reuse the
# tracked data from earlier frames.
self.init_done = True
self.last_init_t = t
Expand Down
4 changes: 2 additions & 2 deletions sleap/nn/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def setup_zmq_callbacks(zmq_config: ZMQConfig) -> List[tf.keras.callbacks.Callba
poll_timeout=zmq_config.controller_polling_timeout,
)
)
logger.info(f" ZMQ controller subcribed to: {zmq_config.controller_address}")
logger.info(f" ZMQ controller subscribed to: {zmq_config.controller_address}")
if zmq_config.publish_updates:
callbacks.append(ProgressReporterZMQ(address=zmq_config.publish_address))
logger.info(f" ZMQ progress reporter publish on: {zmq_config.publish_address}")
Expand Down Expand Up @@ -745,7 +745,7 @@ def _setup_model(self):

# Resuming training if flagged
if self.config.model.base_checkpoint is not None:
# TODO (AL): Add flexibilty to resume from any checkpoint (e.g.
# TODO (AL): Add flexibility to resume from any checkpoint (e.g.
# latest_model, specific epoch, etc.)

# Grab the 'best_model.h5' file from the previous training run
Expand Down
2 changes: 1 addition & 1 deletion sleap/rangelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def cut(self, cut: int):
return self.cut_(self.list, cut)

def cut_range(self, cut: tuple):
"""Return three lists, everthing before/within/after cut range."""
"""Return three lists, everything before/within/after cut range."""
if not self.list:
return [], [], []
cut = self._as_tuple(cut)
Expand Down
Loading

0 comments on commit a83e15d

Please sign in to comment.