Skip to content

Commit

Permalink
dynamic versioning (#55)
Browse files Browse the repository at this point in the history
* dynamic versioning

* bad version file

* require python 3.11 or better

* stricter ruff due to py311
  • Loading branch information
tjlane authored Oct 30, 2024
1 parent 2405dfd commit 4086e4a
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ __pycache__/
*.so

# Distribution / packaging
_version.py
.Python
build/
develop-eggs/
Expand Down
3 changes: 3 additions & 0 deletions meteor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__all__ = ["__version__", "version"]

from ._version import __version__, version
2 changes: 1 addition & 1 deletion meteor/diffmaps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Sequence
from collections.abc import Sequence

import numpy as np
import reciprocalspaceship as rs
Expand Down
2 changes: 1 addition & 1 deletion meteor/iterative.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable
from collections.abc import Callable

import numpy as np
import pandas as pd
Expand Down
3 changes: 2 additions & 1 deletion meteor/rsmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from pathlib import Path
from typing import Any, Callable, ClassVar, Literal, overload
from typing import Any, ClassVar, Literal, overload

import gemmi
import numpy as np
Expand Down
4 changes: 1 addition & 3 deletions meteor/scale.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
from __future__ import annotations

from typing import Tuple

import numpy as np
import pandas as pd
import reciprocalspaceship as rs
import scipy.optimize as opt

from .rsmap import Map

ScaleParameters = Tuple[float, float, float, float, float, float, float]
ScaleParameters = tuple[float, float, float, float, float, float, float]
""" 7x float tuple to hold anisotropic scaling parameters """


Expand Down
3 changes: 2 additions & 1 deletion meteor/tv.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import json
from collections.abc import Sequence
from dataclasses import asdict, dataclass
from pathlib import Path
from typing import Literal, Sequence, overload
from typing import Literal, overload

import numpy as np
from skimage.restoration import denoise_tv_chambolle
Expand Down
2 changes: 1 addition & 1 deletion meteor/validate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable, Sequence
from collections.abc import Callable, Sequence

import numpy as np
from scipy.optimize import minimize_scalar
Expand Down
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[build-system]
requires = ["setuptools >= 61.0", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "meteor"
description = "denoise crystallographic difference maps"
version = "0.2.0"
dynamic = ["version"]
authors = [
{ name = "Alisia Fadini", email = "[email protected]" },
{ name = "Thomas Lane", email = "[email protected]" }
]
requires-python = ">=3.11"
dependencies = [
"numpy >= 1.26",
"scipy >= 1.14.0",
Expand All @@ -21,14 +26,13 @@ tests = [
"pytest-cov",
]

[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project.scripts]
"meteor.diffmap" = "meteor.scripts.compute_difference_map:main"
"meteor.phaseboost" = "meteor.scripts.compute_iterative_tv_map:main"

[tool.setuptools_scm]
version_file = "meteor/_version.py"

[tool.mypy]
disallow_untyped_calls = true
disallow_untyped_defs = true
Expand Down
3 changes: 2 additions & 1 deletion test/unit/scripts/test_compute_iterative_tv_map.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import argparse
from collections.abc import Sequence
from pathlib import Path
from typing import Any, Sequence
from typing import Any
from unittest import mock

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_diffmaps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Callable
from collections.abc import Callable

import numpy as np
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable
from collections.abc import Callable

import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_tv.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Sequence
from dataclasses import asdict
from pathlib import Path
from typing import Sequence

import numpy as np
import pandas as pd
Expand Down

0 comments on commit 4086e4a

Please sign in to comment.