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

Maintain #8

Merged
merged 7 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
current_version = 0.0.10
commit = True
tag = False

[bumpversion:file:pyproject.toml]

[bumpversion:file:compositionspace/__init__.py]
24 changes: 0 additions & 24 deletions .vscode/launch.json

This file was deleted.

17 changes: 0 additions & 17 deletions .vscode/settings.json

This file was deleted.

3 changes: 3 additions & 0 deletions compositionspace/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__version__ = "0.0.10"
__nexus__version__ = "v2022.07.post1.dev1189+g92f26b528"
__nexus__version__hash__ = "92f26b528"
16 changes: 9 additions & 7 deletions compositionspace/preparation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import numpy as np
import yaml

from compositionspace.get_gitrepo_commit import get_repo_last_commit
from compositionspace.get_nexus_version import get_nexus_version, get_nexus_version_hash

from compositionspace import __nexus__version__, __nexus__version__hash__, __version__
from compositionspace.io import (
get_iontypes,
get_ranging_info,
Expand Down Expand Up @@ -39,13 +39,15 @@ def __init__(
if os.path.exists(config_file_path):
with open(config_file_path, "r") as yml:
self.config = fd.FlatDict(yaml.safe_load(yml), delimiter="/")
elif isinstance(config_file_path, dict):
self.config = fd.FlatDict(config_file_path, delimiter="/")
else:
raise IOError(f"File {config_file_path} does not exist!")
self.config["config_file_path"] = config_file_path
self.config["results_file_path"] = results_file_path
self.config["entry_id"] = entry_id
self.verbose = verbose
self.version = get_repo_last_commit()
self.version = __version__
self.voxel_identifier = None
self.n_ions = 0
self.itypes: dict = {}
Expand All @@ -66,9 +68,9 @@ def write_init_results(self):
).isoformat() # .replace("+00:00", "Z")
# /@file_update_time
h5w.attrs["NeXus_repository"] = (
f"https://github.com/FAIRmat-NFDI/nexus_definitions/blob/{get_nexus_version_hash()}"
f"https://github.com/FAIRmat-NFDI/nexus_definitions/blob/{__nexus__version__hash__}"
)
h5w.attrs["NeXus_version"] = get_nexus_version()
h5w.attrs["NeXus_version"] = __nexus__version__
h5w.attrs["HDF5_version"] = ".".join(map(str, h5py.h5.get_libversion()))
h5w.attrs["h5py_version"] = h5py.__version__

Expand All @@ -82,9 +84,9 @@ def write_init_results(self):
grp = h5w.create_group(trg)
grp.attrs["NX_class"] = "NXprogram"
dst = h5w.create_dataset(f"{trg}/program", data="compositionspace")
dst.attrs["version"] = get_repo_last_commit()
dst.attrs["version"] = __version__
dst.attrs["url"] = (
f"https://github.com/eisenforschung/CompositionSpace/blob/{get_repo_last_commit()}"
f"https://github.com/eisenforschung/CompositionSpace/releases/tag/{__version__}"
)
h5w.close()

Expand Down
14 changes: 9 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "compositionspace"
dynamic = ["version"]
version = '0.0.10'
authors = [
{ name = "Alaukik Saxena, Sarath Menon, Mariano Forti, Markus Kühbach" },
]
Expand All @@ -26,7 +26,7 @@ dependencies = [
"h5py",
"scikit-learn",
"trimesh",
"ifes_apt_tc_data_modeling>=0.2.1",
"ifes_apt_tc_data_modeling>=0.2.1",
"pyyaml",
"flatdict",
"lxml",
Expand All @@ -53,13 +53,17 @@ dev = [
"pip-tools",
]

[tool.setuptools]
packages = ["compositionspace"]
#package-dir = {"" = "compositionspace"}

[tool.setuptools_scm]
version_scheme = "no-guess-dev"
local_scheme = "node-and-date"

[tool.setuptools.packages.find]
include = ["compositionspace/*"]
exclude = ["development/*", "nexus_definitions/*"]
#[tool.setuptools.packages.find]
#include = ["compositionspace/*"]
#exclude = ["development/*", "nexus_definitions/*"]

[tool.ruff]
include = ["compositionspace/*.py", "tests/*.py"]
Expand Down
Loading