Skip to content

Commit

Permalink
Reworked version definition.
Browse files Browse the repository at this point in the history
Removed import from __future__ and thus compatibility with python 3.10
  • Loading branch information
mpasson committed Jan 7, 2024
1 parent 9d3dc13 commit 3e5d23c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
10 changes: 1 addition & 9 deletions A_FMM/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,5 @@
from A_FMM.stack import Stack
import A_FMM.inputs as inputs

try:
from ._version import __version__
except ModuleNotFoundError:
from hatch_vcs.version_source import VCSVersionSource
import toml

basedir = os.path.split(os.path.dirname(__file__))[0]
config = toml.load(os.path.join(basedir, "pyproject.toml"))
vcs_version = VCSVersionSource(basedir, config["tool"]["hatch"]["version"])
__version__ = vcs_version.get_version_data()["version"]
from ._version import __version__
8 changes: 8 additions & 0 deletions A_FMM/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pathlib import Path
from hatch_vcs.version_source import VCSVersionSource
import toml

basedir = Path(__file__).parent.parent
config = toml.load(basedir/"pyproject.toml")
vcs_version = VCSVersionSource(basedir, config["tool"]["hatch"]["version"])
__version__ = vcs_version.get_version_data()["version"]
4 changes: 2 additions & 2 deletions A_FMM/stack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations
from typing import Self

import numpy as np

Expand Down Expand Up @@ -448,7 +448,7 @@ def double(self) -> None:
except AttributeError:
raise RuntimeError("structure not solved yet")

def join(self, st2: Stack) -> None:
def join(self, st2: Self) -> None:
"""Join the scattering matrix of the structure with the one of a second structure
When doing this, the lenght of the first al last layeror each stack are ignored (set to 0).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
Expand Down

0 comments on commit 3e5d23c

Please sign in to comment.