6 Commits

Author SHA1 Message Date
f9844d6b82 Updating for version 0.7.12
All checks were successful
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
pyzebra CI/CD pipeline / prod-env (push) Successful in 1m45s
pyzebra CI/CD pipeline / test-env (push) Has been skipped
2026-02-06 16:37:27 +01:00
040588d054 Update paths to anatric and Sxtal_Refgen
All checks were successful
pyzebra CI/CD pipeline / test-env (push) Successful in 2m0s
pyzebra CI/CD pipeline / prod-env (push) Has been skipped
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
2026-02-05 13:59:24 +01:00
cd4055b246 Migrate to NFS share for sinq data
All checks were successful
pyzebra CI/CD pipeline / test-env (push) Successful in 2m8s
pyzebra CI/CD pipeline / prod-env (push) Has been skipped
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
2026-02-05 10:27:21 +01:00
457a974e14 Remove redundant gitea workflow job
All checks were successful
pyzebra CI/CD pipeline / test-env (push) Successful in 1m50s
pyzebra CI/CD pipeline / prod-env (push) Has been skipped
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
These steps are executed during the initial deployment
2025-11-07 16:46:24 +01:00
ec685d24eb Switch from os.path to pathlib
All checks were successful
pyzebra CI/CD pipeline / prepare (push) Successful in 1s
pyzebra CI/CD pipeline / test-env (push) Successful in 1m53s
pyzebra CI/CD pipeline / prod-env (push) Has been skipped
pyzebra CI/CD pipeline / cleanup (push) Successful in 1s
2025-11-06 13:54:58 +01:00
57c0037289 Migrate to pyproject.toml 2025-11-06 13:51:26 +01:00
9 changed files with 61 additions and 45 deletions

View File

@@ -11,15 +11,8 @@ env:
CONDA: /opt/miniforge3
jobs:
prepare:
runs-on: pyzebra
steps:
- run: $CONDA/bin/conda config --add channels conda-forge
- run: $CONDA/bin/conda config --set solver libmamba
test-env:
runs-on: pyzebra
needs: prepare
if: github.ref == 'refs/heads/main'
env:
BUILD_DIR: ${{ runner.temp }}/conda_build
@@ -33,7 +26,6 @@ jobs:
prod-env:
runs-on: pyzebra
needs: prepare
if: startsWith(github.ref, 'refs/tags/')
env:
BUILD_DIR: ${{ runner.temp }}/conda_build

View File

@@ -1,8 +1,10 @@
{% set data = load_setup_py_data() %}
{% set version_match = load_file_regex(load_file="pyzebra/__init__.py", regex_pattern='__version__ = "(.+?)"') %}
{% set version = version_match[1] %}
{% set pyproject = load_file_data('pyproject.toml') %}
package:
name: pyzebra
version: {{ data['version'] }}
name: {{ pyproject['project']['name'] }}
version: {{ version }}
source:
path: ..
@@ -10,26 +12,25 @@ source:
build:
script: python -m pip install .
noarch: python
number: 0
entry_points:
- pyzebra = pyzebra.app.cli:main
requirements:
build:
host:
- python >=3.8
- setuptools
- hatchling
run:
- python >=3.8
- numpy
- scipy
- h5py
- bokeh =2.4
- numba
- lmfit >=1.0.2
{% for dep in pyproject['project']['dependencies'] %}
- {{ dep }}
{% endfor %}
about:
home: https://gitlab.psi.ch/zebra/pyzebra
summary: {{ data['description'] }}
license: GNU GPLv3
license_file: LICENSE
home: {{ pyproject['project']['urls']['Homepage'] }}
summary: {{ pyproject['project']['description'] }}
license: {{ pyproject['project']['license'] }}
license_file:
{% for lf in pyproject['project']['license-files'] %}
- {{ lf }}
{% endfor %}

View File

@@ -4,6 +4,7 @@ import argparse
import os
import re
import subprocess
from pathlib import Path
def main():
@@ -13,7 +14,8 @@ def main():
print(f"Aborting, not on '{default_branch}' branch.")
return
version_filepath = os.path.join(os.path.basename(os.path.dirname(__file__)), "__init__.py")
project_path = Path(__file__).resolve().parent
version_filepath = project_path / project_path.name / "__init__.py"
parser = argparse.ArgumentParser()
parser.add_argument("level", type=str, choices=["patch", "minor", "major"])
@@ -22,7 +24,7 @@ def main():
with open(version_filepath) as f:
file_content = f.read()
version = re.search(r'__version__ = "(.*?)"', file_content).group(1)
version = re.search(r'__version__ = "(.+?)"', file_content).group(1)
major, minor, patch = map(int, version.split(sep="."))
if args.level == "patch":
@@ -38,7 +40,7 @@ def main():
new_version = f"{major}.{minor}.{patch}"
with open(version_filepath, "w") as f:
f.write(re.sub(r'__version__ = "(.*?)"', f'__version__ = "{new_version}"', file_content))
f.write(re.sub(r'__version__ = "(.+?)"', f'__version__ = "{new_version}"', file_content))
os.system(f"git commit {version_filepath} -m 'Updating for version {new_version}'")
os.system(f"git tag -a {new_version} -m 'Release {new_version}'")

35
pyproject.toml Normal file
View File

@@ -0,0 +1,35 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "pyzebra"
dynamic = ["version"] # version will be read from __init__.py
requires-python = ">=3.8"
dependencies = [
"numpy",
"scipy",
"h5py",
"bokeh ~=2.4",
"numba",
"lmfit >=1.0.2",
]
authors = [
{name = "Paul Scherrer Institute"}
]
maintainers = [
{name = "Ivan Usov", email = "ivan.usov@psi.ch"}
]
description = "An experimental data analysis library for zebra instrument."
readme = "README.md"
license = "GPL-3.0-or-later"
license-files = ["LICENSE"]
[project.urls]
Homepage = "https://gitea.psi.ch/zebra/pyzebra"
[tool.hatch.build.targets.wheel]
include = ["pyzebra"]
[tool.hatch.version]
path = "pyzebra/__init__.py"

View File

@@ -6,4 +6,4 @@ from pyzebra.sxtal_refgen import *
from pyzebra.utils import *
from pyzebra.xtal import *
__version__ = "0.7.11"
__version__ = "0.7.12"

View File

@@ -19,7 +19,7 @@ REFLECTION_PRINTER_FORMATS = [
"oksana",
]
ANATRIC_PATH = "/afs/psi.ch/project/sinq/rhel8/bin/anatric"
ANATRIC_PATH = "/opt/anatric"
ALGORITHMS = ["adaptivemaxcog", "adaptivedynamic"]

View File

@@ -9,7 +9,7 @@ import numpy as np
logger = logging.getLogger(__name__)
SXTAL_REFGEN_PATH = "/afs/psi.ch/project/sinq/rhel8/bin/Sxtal_Refgen"
SXTAL_REFGEN_PATH = "/opt/Sxtal_Refgen"
_zebraBI_default_geom = """GEOM 2 Bissecting - HiCHI
BLFR z-up

View File

@@ -2,7 +2,7 @@ import os
import numpy as np
SINQ_PATH = "/afs/psi.ch/project/sinqdata"
SINQ_PATH = "/sq_data"
ZEBRA_PROPOSALS_PATH = os.path.join(SINQ_PATH, "{year}/zebra/{proposal}")

View File

@@ -1,14 +0,0 @@
import re
from setuptools import find_packages, setup
with open("pyzebra/__init__.py") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
setup(
name="pyzebra",
version=version,
description="An experimental data analysis library for zebra instrument.",
packages=find_packages(),
license="GNU GPLv3",
)