Skip to content

Commit

Permalink
Merge pull request #21 from cryoem-uoft/release-v4.2
Browse files Browse the repository at this point in the history
Release v4.2.0
  • Loading branch information
nfrasser authored Feb 27, 2023
2 parents bf8a269 + 8460abe commit cf03e4d
Show file tree
Hide file tree
Showing 13 changed files with 112 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ ipython_config.py

# Other
.ruff_cache
.vercel
cryosparc/core.c
*.dSYM
Python-*
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v4.2.0

- Support for CryoSPARC v4.2

## v4.1.3

- Fix error when creating a job with `CryoSPARC.create_job`
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 Structura Biotechnology Inc.
Copyright 2023 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
55 changes: 53 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,68 @@
# Actual target is a .so file with a dynamically-determined name, but this is
# close enough
TARGET=cryosparc/core.c
PYTHON=python3.9
PYTHON_VERSION=3.9.16

all: $(TARGET)

# -----------------------------------------------------------------------------
# Primary build target
# -----------------------------------------------------------------------------

$(TARGET): cryosparc/include/cryosparc-tools/*.h cryosparc/dataset.c cryosparc/*.pyx cryosparc/*.pxd setup.py pyproject.toml
python -m setup build_ext -i

# -----------------------------------------------------------------------------
# Vercel deployment-related targets
# -----------------------------------------------------------------------------

Python-$(PYTHON_VERSION).tgz:
curl -L https://www.python.org/ftp/python/$(PYTHON_VERSION)/Python-$(PYTHON_VERSION).tgz -o Python-$(PYTHON_VERSION).tgz

Python-$(PYTHON_VERSION): Python-$(PYTHON_VERSION).tgz
tar -xzf Python-${PYTHON_VERSION}.tgz

python: Python-$(PYTHON_VERSION)
cd Python-$(PYTHON_VERSION) && ./configure && cd .. || cd ..
make -C Python-$(PYTHON_VERSION)
make -C Python-$(PYTHON_VERSION) altinstall

.venv/bin/python:
$(PYTHON) -m venv .venv

.venv/bin/pip: .venv/bin/python
.venv/bin/python -m pip install -U pip

.venv/bin/jupyter-book: .venv/bin/pip
.venv/bin/pip install -e ".[build]"

.vercel/output/config.json:
mkdir -p .vercel/output
echo '{"version":3,"cache":[".venv/**","build/**","docs/_build/**","Python-*.tgz","Python-*/**"]}' > .vercel/output/config.json

verceldeps:
yum update -y
yum install bzip2-devel libffi-devel openssl-devel sqlite-devel -y

vercelinstall: verceldeps python .venv/bin/python
echo "Install complete"

vercelbuild: .vercel/output/config.json .venv/bin/jupyter-book
.venv/bin/jupyter-book build docs
rm -rf .vercel/output/static && cp -R docs/_build/html .vercel/output/static

# -----------------------------------------------------------------------------
# Cleanup
# -----------------------------------------------------------------------------

clean:
rm -f $(TARGET)
rm -f *.tgz *.tar.gz
rm -f cryosparc/*.so
rm -f cryosparc/core.c
rm -rf build
rm -rf dist
rm -rf *.egg-info
rm -rf Python-$(PYTHON_VERSION)

.PHONY: clean all
.PHONY: clean all python verceldeps vercelinstall vercelbuild
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.1.3"
__version__ = "4.2.0"


def get_include():
Expand Down
25 changes: 23 additions & 2 deletions cryosparc/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ class Job(MongoController[JobDocument]):
outputs, add to job log, download job files. Should be instantiated
through `CryoSPARC.find_job`_ or `Project.find_job`_.
Attributes:
uid (str): Job unique ID, e.g., "J42"
project_uid (str): Project unique ID, e.g., "P3"
doc (JobDocument): All job data from the CryoSPARC database. Database
contents may change over time, use the `refresh`_ method to update.
Examples:
Find an existing job.
Expand Down Expand Up @@ -70,6 +76,9 @@ class Job(MongoController[JobDocument]):
.. _Project.find_job:
project.html#cryosparc.project.Project.find_job
.. _refresh:
#cryosparc.job.Job.refresh
"""

def __init__(self, cs: "CryoSPARC", project_uid: str, uid: str) -> None:
Expand Down Expand Up @@ -926,7 +935,14 @@ class ExternalJob(Job):
an input. Its outputs must be created manually and may be configured to
passthrough inherited input fields, just as with regular CryoSPARC jobs.
Create a new External Job with `Project.create_external_job`_.
Create a new External Job with `Project.create_external_job`_. ExternalJob
is a subclass of `Job`_ and inherits all its methods.
Attributes:
uid (str): Job unique ID, e.g., "J42"
project_uid (str): Project unique ID, e.g., "P3"
doc (JobDocument): All job data from the CryoSPARC database. Database
contents may change over time, use the `refresh`_ method to update.
Examples:
Expand All @@ -946,9 +962,14 @@ class ExternalJob(Job):
... dset['movie_blob/path'] = ... # populate dataset
... job.save_output(output_name, dset)
.. _Job:
#cryosparc.job.Job
.. _refresh:
#cryosparc.job.Job.refresh
.. _Project.create_external_job:
project.html#cryosparc.project.Project.create_external_job
"""

def add_input(
Expand Down
9 changes: 9 additions & 0 deletions cryosparc/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ class Project(MongoController[ProjectDocument]):
and upload/download project files. Should be instantiated through
`CryoSPARC.find_project`_.
Attributes:
uid (str): Project unique ID, e.g., "P3"
doc (ProjectDocument): All project data from the CryoSPARC database.
Database contents may change over time, use the `refresh`_ method
to update.
.. _CryoSPARC.find_project:
tools.html#cryosparc.tools.CryoSPARC.find_project
.. _refresh:
#cryosparc.project.Project.refresh
"""

def __init__(self, cs: "CryoSPARC", uid: str) -> None:
Expand Down
10 changes: 10 additions & 0 deletions cryosparc/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ class Workspace(MongoController[WorkspaceDocument]):
results. Should be instantiated through `CryoSPARC.find_workspace`_ or
`Project.find_workspace`_.
Attributes:
uid (str): Workspace unique ID, e.g., "W42"
project_uid (str): Project unique ID, e.g., "P3"
doc (WorkspaceDocument): All workspace data from the CryoSPARC database.
Database contents may change over time, use the `refresh`_ method
to update.
.. _CryoSPARC.find_workspace:
tools.html#cryosparc.tools.CryoSPARC.find_workspace
.. _Project.find_workspace:
project.html#cryosparc.project.Project.find_workspace
.. _refresh:
#cryosparc.workspace.Workspace.refresh
"""

def __init__(self, cs: "CryoSPARC", project_uid: str, uid: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ html:
use_repository_button: true
extra_footer: |
<p>
© 2022 Structura Biotechnology Inc. Toronto, Canada<br>
© 2023 Structura Biotechnology Inc. Toronto, Canada<br>
CryoSPARC and CryoSPARC Live are trademarks of Structura Biotechnology Inc.
</p>
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cryosparc-tools"
version = "4.1.3"
version = "4.2.0"
description = "Toolkit for interfacing with CryoSPARC"
readme = "README.md"
requires-python = ">=3.7"
Expand Down Expand Up @@ -40,7 +40,6 @@ dev = [

build = [
"build",
"black[jupyter]",
"autodocsumm",
"cython",
"jupyter-book",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name="cryosparc_tools",
version="4.1.3",
version="4.2.0",
description="Toolkit for interfacing with CryoSPARC",
headers=["cryosparc/include/cryosparc-tools/dataset.h"],
ext_modules=cythonize(
Expand Down
25 changes: 0 additions & 25 deletions vercel-install.sh

This file was deleted.

6 changes: 6 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"framework": null,
"installCommand": "make vercelinstall",
"buildCommand": "make vercelbuild",
"outputDirectory": "docs/_build/html"
}

1 comment on commit cf03e4d

@vercel
Copy link

@vercel vercel bot commented on cf03e4d Feb 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.