Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.5.0 #86

Merged
merged 34 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b4233bc
Project.dir and Job.dir should be properties (#65)
PlethoraChutney Dec 5, 2023
78d483c
Merge branch 'release-v4.4' into develop
nfrasser Dec 5, 2023
052a21d
Fix: Type issues for latest Pyright (#68)
nfrasser Dec 8, 2023
efab4c6
Merge remote-tracking branch 'origin/release-v4.4' into develop
nfrasser Dec 8, 2023
27880ed
Fix .dir() documentation examples (#69)
PlethoraChutney Dec 18, 2023
5c9b4b3
Fix broken code in custom latent trajectory example (#70)
PlethoraChutney Dec 19, 2023
7d3f3ee
Generalize 3dflex custom traj to >2 dimensions
PlethoraChutney Jan 4, 2024
1dd8265
chore: 2023 -> 2024
nfrasser Jan 10, 2024
f7b7af4
Chore: Replace black with ruff format (#72)
nfrasser Jan 23, 2024
d0f01c1
fix: add missing ruff flag in precommit
nfrasser Jan 23, 2024
b60bb83
docs: update lint/format instructions in contributing guide
nfrasser Jan 23, 2024
3142685
chore: update to lz4 to v1.9.4
nfrasser Feb 2, 2024
4ad4e95
Docs: update contribution guidelines (#75)
nfrasser Feb 12, 2024
c0a21f6
CI: update actions to use Node.js 20 (#76)
nfrasser Feb 12, 2024
0606379
docs: fix grammar in readme/intro
nfrasser Feb 13, 2024
656ac46
Merge pull request #71 from PlethoraChutney/custom-traj
PlethoraChutney Feb 29, 2024
d65d613
SPM Job changes (#74)
Puratinamu Feb 29, 2024
ad88f32
chore: run linter (#78)
nfrasser Mar 1, 2024
9644af4
Feat(dataset): use 16 bits for dataset shapes instead of 8 (#77)
nfrasser Mar 1, 2024
eaf556d
Feat: add cluster_vars to job.queue (#79)
nfrasser Mar 14, 2024
7a042e0
Fix: keep fields when appending empty datasets (#81)
nfrasser Mar 18, 2024
02c6386
docs: fix typo, add editor config
nfrasser Mar 18, 2024
f1275da
chore: addtional editorconfig options
nfrasser Mar 18, 2024
598c3c8
Fix: keep fields when unionizing empty datasets (#82)
nfrasser Mar 18, 2024
6c88a93
Fix: raise explicit memory error when dataset allocation fails (#80)
nfrasser Mar 20, 2024
04deaf6
Fix: API and docs updates to allow copying/linking outside job direct…
nfrasser Mar 25, 2024
b0d1e4a
fix: typos
nfrasser Mar 25, 2024
2058d2f
Fix: correct Dataset.descr() implementation (#84)
nfrasser Apr 17, 2024
815da94
Fix: revert @property decorator for project/job dir (#85)
nfrasser Apr 22, 2024
fbf4e01
Docs: New Jobs guide, improved crYOLO instructions, improved examples…
nfrasser Apr 24, 2024
c569053
fix(dataset): make load_cached method private
nfrasser May 7, 2024
070c604
ci: disable for pull requests to main branch
nfrasser May 7, 2024
0d77d56
v4.5.0
nfrasser May 7, 2024
0765418
fix: correct pyproject.toml license definition
nfrasser May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_size = 2

[*.yml]
indent_size = 2
34 changes: 20 additions & 14 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
push:
branches:
- main
- develop
- release-*
pull_request:
branches:
- main
- develop
- release-**
- release-*
release:
types:
- published
Expand All @@ -24,10 +25,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
Expand All @@ -36,15 +37,15 @@ jobs:
run: |
python -m pip install --upgrade pip wheel
python -m pip install --editable .[dev]
- name: Lint with black and ruff
- name: Lint with ruff
run: |
black --check .
ruff .
ruff check --select I .
ruff format --check .
- name: Type check with Pyright
run: pyright
- name: Build sdist
run: python -m build --sdist --no-isolation --skip-dependency-check --outdir dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
Expand All @@ -57,13 +58,18 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.7", "3.12"]
exclude:
# Latest macos runner does not support older Python versions
# https://github.com/actions/setup-python/issues/852
- os: macos-latest
python-version: "3.7"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -90,7 +96,7 @@ jobs:
matrix:
os: ["ubuntu-20.04", "macos-11", "windows-2019"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up QEMU
Expand All @@ -106,7 +112,7 @@ jobs:
CIBW_ARCHS_WINDOWS: "AMD64 ARM64"
with:
output-dir: dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
Expand All @@ -117,10 +123,10 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [build]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: wheels
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Publish to PyPI
Expand Down
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.4.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
args: [--fix, --select, I, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.335
rev: v1.1.359
hooks:
- id: pyright
additional_dependencies: [cython, httpretty, numpy, pytest]
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## v4.5.0

- Added: New `cluster_vars` argument for `Job.queue` method for queueing to clusters
- Added: Various `print` methods for inspecting available job types, inputs, outputs and parameters
- Updated: Allow copy and symlink operations from outside project directory
- Updated: Allow larger shapes for dataset fields
- Fixed: Always raise explicit errors when dataset allocation fails
- Fixed: Correctly retain fields when appending or creating a union of empty datasets with non-empty fields
- Fixed: Correctly allow excluding `uid` field in `Dataset.descr` method
- Docs: New guide for job access and inspection
- Docs: Fix broken code in custom latent trajectory example
- Docs: Generalize 3D Flex custom trajectory example to >2 dimensions

## v4.4.1

- Fixed: Correct command response error data formatting
Expand Down
24 changes: 8 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,13 @@ Thanks for taking the time to contribute! See the [Table of Contents](#table-of-

> If you want to ask a question, we assume that you have read the available [Documentation](https://tools.cryosparc.com).

Before asking a question, search for existing [Issues](https://github.com/cryoem-uoft/cryosparc-tools/issues) that might help. If additional clarification is needed for a relevant issue, write a question in this issue. Search the [CryoSPARC Discussion Forum](https://discuss.cryosparc.com) for additional help.

If you still have a question and need clarification, we recommend the following:

- Open an [Issue](https://github.com/cryoem-uoft/cryosparc-tools/issues/new).
- Provide as much context as you can about what you're running into.
- Provide project and platform versions (operating system, python version, pip/conda version, etc), depending on what seems relevant.

Structura will address the issue as soon as possible.
For usage questions and general discussion about `cryosparc-tools` scripts and functions, please post to the [CryoSPARC discussion forum](https://discuss.cryosparc.com/c/scripting) under the Scripting category.

## I Want to Contribute

> ### Legal Notice <!-- omit in toc -->
>
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license (BSD-3-Clause).

### Reporting Bugs

Expand Down Expand Up @@ -124,8 +116,8 @@ Run the following commands to check the code for issues related to type-safety,

```sh
pyright
ruff .
black .
ruff check .
ruff format .
```

Commit your changes and [submit a pull request](https://github.com/cryoem-uoft/cryosparc-tools/compare). The pull request will be reviewed by someone on the Stuctura team. Check your GitHub notifications periodically for change requests. Once the pull request is approved, it will be merged to the `main` branch and deployed in the next release.
Expand All @@ -138,12 +130,12 @@ Inline source documentation is compiled to HTML via [Sphinx](https://www.sphinx-

## Styleguides

cryosparc-tools uses [black](https://black.readthedocs.io/en/stable/) for
formatting source code. Configuration options for black are included in
cryosparc-tools uses [ruff](https://docs.astral.sh/ruff/formatter/) for
formatting source code. Configuration options for ruff are included in
pyproject.toml

To format code with the required style, run `black .` in the cryosparc-tools
directory.
To format code with the required style, run `ruff format .` in the
cryosparc-tools directory.

### Commit Messages

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 Structura Biotechnology Inc.
Copyright 2024 Structura Biotechnology Inc.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ all: $(TARGET)
$(TARGET): cryosparc/include/cryosparc-tools/*.h cryosparc/dataset.c cryosparc/*.pyx cryosparc/*.pxd setup.py pyproject.toml
python3 -m setup build_ext -i

# -----------------------------------------------------------------------------
# Docs
# -----------------------------------------------------------------------------
docs:
jupyter-book build docs

# -----------------------------------------------------------------------------
# Vercel deployment-related targets
# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -45,4 +51,4 @@ clean:
rm -rf *.egg-info
rm -rf .venv

.PHONY: clean all vercelinstall vercelbuild
.PHONY: clean all docs vercelinstall vercelbuild
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
Toolkit for interfacing with CryoSPARC. Read the documentation at
[tools.cryosparc.com](https://tools.cryosparc.com)

## Getting Help and Reporting Bugs

For usage questions and general discussion about `cryosparc-tools` scripts and functions, please post to the [CryoSPARC discussion forum](https://discuss.cryosparc.com/c/scripting) under the Scripting category.

If you would like to request or propose a feature, change or fix for `cryosparc-tools` source code, please either [report an issue](https://github.com/cryoem-uoft/cryosparc-tools/issues/new) or [submit a pull request](https://github.com/cryoem-uoft/cryosparc-tools/compare).

See [CONTRIBUTING.md](CONTRIBUTING.md) for full details.

## Development

### Prerequisites
Expand Down
2 changes: 1 addition & 1 deletion cryosparc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.4.1"
__version__ = "4.5.0"


def get_include():
Expand Down
5 changes: 3 additions & 2 deletions cryosparc/column.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Optional

import numpy as n

from .core import Data
Expand Down Expand Up @@ -62,10 +63,10 @@ def __new__(cls, field: Field, data: Data):

return obj

def __array_wrap__(self, obj, **kwargs):
def __array_wrap__(self, obj, context=None):
# This prevents wrapping single results such as aggregations from n.sum
# or n.median
return obj[()] if obj.shape == () else super().__array_wrap__(obj, **kwargs)
return obj[()] if obj.shape == () else super().__array_wrap__(obj, context)

def to_fixed(self) -> "Column":
"""
Expand Down
5 changes: 3 additions & 2 deletions cryosparc/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
Provides classes and functions for communicating with CryoSPARC's command
servers. Generally should not be used directly.
"""
from contextlib import contextmanager

import json
import os
import socket
import time
import uuid
from contextlib import contextmanager
from typing import Optional, Type
from urllib.request import urlopen, Request
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import Request, urlopen
from warnings import warn

from .errors import CommandError
Expand Down
Loading