Skip to content

Commit

Permalink
Merge pull request #36 from cgevans/echo
Browse files Browse the repository at this point in the history
Echo support
  • Loading branch information
cgevans authored Aug 2, 2024
2 parents b2e3088 + cf04f7e commit d0ed966
Show file tree
Hide file tree
Showing 31 changed files with 1,229 additions and 416 deletions.
61 changes: 18 additions & 43 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,62 +19,37 @@ on:
- CHANGELOG.md
- README.md
- AUTHORS.md
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
# black:
# runs-on: ubuntu-latest
# steps:
# - name: Set up Python 3.10
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# - uses: actions/checkout@v3
# - uses: psf/black@stable
# with:
# options: "--check --verbose --diff"
# src: "./src"
mypy:
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools_scm[toml] wheel setuptools
python -m pip install --upgrade attrs types-attrs types-tabulate types-PyYAML types-toml
python -m pip install --upgrade mypy
python -m pip install --upgrade .
mkdir -p .mypy_cache
- name: Mypy
run: |
mypy --cache-dir .mypy_cache --install-types --non-interactive --show-traceback ./src/alhambra_mixes
tests:
#needs: "mypy"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install Hatch
run: pip install --upgrade hatch coverage
- name: Run tests
run: |
python -m pip install --upgrade pip setuptools_scm[toml] wheel setuptools
python -m pip install --upgrade pytest
python -m pip install --upgrade .[testing]
- name: Test with tox/pytest
run: |
python -m pytest --cov alhambra_mixes --cov-report=xml
hatch test --python ${{ matrix.python-version }} --cover --randomize
coverage xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: false
30 changes: 30 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
BSD 3-Clause License

Copyright (c) 2024, Constantine Evans and other contributors.

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ components at different concentrations spread across several plates.

# Changelog

## v0.6.0

- Optional ECHO liquid handler support, with the 'echo' feature (eg, `pip install --upgrade alhambra_mixes[echo]`). Uses [kithairon](https://github.com/cgevans/kithairon), which
does require Python ≥ 3.10.

## v0.5.0

An interim version release while larger changes are being made, so that users can make use of several important new features, and the pypi-available version fits well with the latest documentation.
Expand Down
65 changes: 54 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
[build-system]
requires = ["setuptools>=60", "setuptools_scm[toml]>=8", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.setuptools_scm]
version_scheme = "no-guess-dev"
write_to = "src/alhambra_mixes/_version.py"
[tool]
rye = { dev-dependencies = [
"pytest>=8.2.2",
] }

[tool.hatch]
version.source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/alhambra_mixes/_version.py"

[tool.pytest.ini_options]
# addopts = "--cov alhambra --cov-report term-missing --cov-report html"
Expand All @@ -14,18 +21,26 @@ norecursedirs = [
".tox"]
testpaths = ["tests"]

[tool.hatch.metadata.hooks.vcs.urls]
Homepage = "https://github.com/cgevans/mixes"
Documentation = "https://alhambra-mixes.readthedocs.io"
Repository = "https://github.com/cgevans/mixes.git"
Issues = "https://github.com/cgevans/issues"
source_archive = "https://github.com/org/repo/archive/{commit_hash}.zip"

[project]
name = "alhambra_mixes"
dynamic = ["version"]
dynamic = ["version", "urls"]
description = "Many-component mix library for molecular programming"
authors = [{name = "Constantine Evans", email="[email protected]"}]
license = { file = "LICENCE.txt" }
license = { file = "LICENSE.txt" }
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
Expand All @@ -36,11 +51,13 @@ dependencies = [
"pandas",
"openpyxl",
"pint >= 0.20",
"polars ~= 0.20.7",
"tabulate",
"toml",
"typing_extensions >= 4.2"
"typing_extensions >= 4.2",
]
readme = "README.md"
requires-python = ">= 3.8"

[project.optional-dependencies]
docs = [
Expand All @@ -55,15 +72,19 @@ testing = [
"pytest",
"pytest-cov"
]
echo = [
"kithairon >= 0.2.0",
]
all = [
"alhambra_mixes[echo]"
]


[tool.setuptools.packages.find]
where = ["src"]



[tool.black]
target_version = ["py39"]
target-version = ["py312"]

[tool.mypy]
python_version = "3.9"
Expand All @@ -72,3 +93,25 @@ warn_unused_configs = true
ignore_missing_imports = true
#disallow_untyped_defs = true
#disallow_incomplete_defs = true

[tool.hatch.envs.hatch-test]
dependencies = [
"pytest",
"pytest-cov",
]

[tool.hatch.envs.hatch-test.overrides]
name.echo.features = ["echo"]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.10", "3.11", "3.12"]
feature = ["echo"]

[tool.ruff]
ignore = ["TID252", "N816", "F405", "F403", "ARG002"
# For now
, "EM101", "EM102", "RET505", "RET504", "TRY003", "PLR2004"
]
5 changes: 5 additions & 0 deletions src/alhambra_mixes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ???

- Make null-plate for component be None, not "". This is ultimately safer in forcing handling of unspecified plates.
- Adding location information.
- Echo support.
51 changes: 40 additions & 11 deletions src/alhambra_mixes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
from .actions import *
from .components import *
from .actions import (
AbstractAction,
EqualConcentration,
FixedConcentration,
FixedVolume,
MultiFixedConcentration,
MultiFixedVolume,
ToConcentration,
)
from .components import AbstractComponent, Component, Strand
from .experiments import Experiment
from .mixes import *
from .printing import *
from .quantitate import *
from .references import *
from .units import *
from .locations import WellPos
from .mixes import Mix, MixLine, master_mix, split_mix
from .quantitate import hydrate_and_measure_conc_and_dilute, measure_conc_and_dilute
from .references import Reference, load_reference
from .units import DNAN, Q_, VolumeError, nM, uL, uM, ureg

__all__ = (
__all__ = [
"uL",
"uM",
"nM",
Expand All @@ -29,11 +37,32 @@
"MixLine",
"Reference",
"load_reference",
# "_format_title",
"DNAN",
"VolumeError",
# "D",
"measure_conc_and_dilute",
"hydrate_and_measure_conc_and_dilute",
"split_mix",
)
"master_mix",
]

try:
from .echo import (
AbstractEchoAction,
EchoEqualTargetConcentration,
EchoFillToVolume,
EchoFixedVolume,
EchoTargetConcentration,
)

__all__ += [
"EchoEqualTargetConcentration",
"EchoFillToVolume",
"EchoFixedVolume",
"EchoTargetConcentration",
"AbstractEchoAction"
]
except ImportError as err:
if err.name == "kithairon":
pass
else:
raise err # noqa
4 changes: 1 addition & 3 deletions src/alhambra_mixes/abbreviated.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from re import L

from .actions import *
from .components import *
from .experiments import Experiment
from .mixes import *
from .references import *
from .units import *
from .experiments import Experiment

__all__ = (
"Q_",
Expand Down Expand Up @@ -36,7 +35,6 @@
S = Strand
C = Component
Ref = Reference
Mix = Mix
Exp = Experiment

µM = ureg.Unit("µM")
Expand Down
Loading

0 comments on commit d0ed966

Please sign in to comment.