From 949302deb01631291cdcef2a07f3131479f29458 Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sat, 25 Apr 2026 22:33:21 +0100 Subject: [PATCH 1/7] Backport fix by Danny from main code --- src/singleion/racah.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/singleion/racah.cpp b/src/singleion/racah.cpp index 8f12a111..09135976 100644 --- a/src/singleion/racah.cpp +++ b/src/singleion/racah.cpp @@ -211,8 +211,8 @@ double racah::ninej(int j1, int j2, int J12, int j3, int j4, int J34, int J13, i double out = 0.; // Finds the allowed values of g - min_g = G[0]; for(g=1; g<3; g++) if(G[g]max_g) max_g = G[g]; + min_g = G[0]; for(g=1; g<3; g++) if(G[g]>min_g) min_g = G[g]; + max_g = G[3]; for(g=4; g<6; g++) if(G[g] Date: Sat, 25 Apr 2026 22:38:26 +0100 Subject: [PATCH 2/7] Update CMakeList for new Eigen syntax --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb55f4ad..1d47116d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,8 +3,8 @@ project(libMcPhase) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) set(CMAKE_MACOSX_RPATH TRUE) -set(CMAKE_CXX_STANDARD 11) -set(CXX_STANDARD_REQUIRED 11) +set(CMAKE_CXX_STANDARD 14) +set(CXX_STANDARD_REQUIRED 14) set(LIBMCPHASE_PYTHON_MODULE libmcphase) @@ -36,6 +36,9 @@ if (EMSCRIPTEN) endif() find_package(Eigen3 REQUIRED NO_MODULE) +if (NOT EIGEN3_INCLUDE_DIR) + get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) +endif() include_directories(${EIGEN3_INCLUDE_DIR}) find_package(pybind11 CONFIG) From c658ee7b97c82a7ff62109a69813ff4374b519d6 Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sat, 25 Apr 2026 22:38:56 +0100 Subject: [PATCH 3/7] Update logs for v0.2 --- CHANGELOG.md | 16 ++++++++++++++++ CITATION.cff | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ed9fc3..54c495b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### [v0.2.0](https://github.com/mducle/libmcphase/compare/v0.1.3...v0.2.0) + +Add `fitengy` algorithm and refactor physical properties calculations. +Add new webassembly version (runs under Pyodide) + +* Refactor physical properties into a separate class inherited by `cf1ion` and `ic1ion`. +* This allows heat capacity and magnetisation / susceptibility calculations to both classes. +* Fix constants and units bug in physical properties calculations +* Change behaviour of magnetisation to be consistent with McPhase and not FOCUS/Mantid + That is, M(H) is outputed as the component parallel to H (`M_parallel`) not the + mean-square of individual components. +* Update CMakeFile and switch to using pyproject.toml and scikit-build +* Add `fitengy` algorithm +* Add Fabi normalised parameters and `split2range` function. + + ### [v0.1.3](https://github.com/mducle/libmcphase/compare/v0.1.2...v0.1.3) Library / dependencies update diff --git a/CITATION.cff b/CITATION.cff index 2424b2d5..4d85146e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ authors: given-names: "Manh Duc" orcid: "https://orcid.org/0000-0003-3012-6053" title: "libmcphase" -version: "0.1.3" +version: "0.2.0" date-released: "2024-09-05" license: "GPL-3.0-only" repository: "https://github.com/mducle/libmcphase" From 114d93f4dea42d7e4a06e9bc322ba6d79d24b45d Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sun, 26 Apr 2026 02:20:52 +0100 Subject: [PATCH 4/7] Pin pybind to 3.0.1 to avoid crosscompiling bug --- .github/workflows/build_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index aff6ef56..32aba715 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -33,7 +33,7 @@ jobs: cache-downloads: true - name: Build wheels run: | - $MAMBA_EXE create -n cibuildwheel python=3.12 eigen pybind11 + $MAMBA_EXE create -n cibuildwheel python=3.12 eigen pybind11=3.0.1 eval "$($MAMBA_EXE shell activate cibuildwheel)" python -m pip install cibuildwheel if [[ $OSTYPE == "linux-gnu" ]] From d1eb846dea65bebc88a23f6a57a7b734242a6117 Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sun, 26 Apr 2026 03:32:39 +0100 Subject: [PATCH 5/7] Update release.py --- release.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/release.py b/release.py index 49f95502..b815aff7 100644 --- a/release.py +++ b/release.py @@ -32,11 +32,10 @@ def main(): def release_github(test=True, create_tag=False, token=None): - rv = subprocess.run([sys.executable, 'setup.py', 'version'], capture_output=True) - __version__ = rv.stdout.decode().split("version': '")[1].split("',")[0] - git_ver = 'v' + __version__ + rv = subprocess.run(['git', 'describe', '--tags', '--dirty', '--always'], capture_output=True) + git_ver = rv.stdout.decode() file_ver, changelog = _version_check() - if '+' in git_ver and create_tag: + if ('-' in git_ver or '+' in git_ver) and create_tag: # Not in a release, create a new tag rv = subprocess.run(['git', 'tag', file_ver], capture_output=True) if rv.returncode != 0: From 47f6c80c898f54cd1977c2d4cd02771b3e47d7f6 Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sun, 26 Apr 2026 03:53:37 +0100 Subject: [PATCH 6/7] Update CI release script --- .github/workflows/build_python.yml | 4 ++++ release.py | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index 32aba715..3e04541b 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -31,6 +31,10 @@ jobs: - uses: mamba-org/setup-micromamba@v1 with: cache-downloads: true + - name: Tag if release + if: contains(github.event.pull_request.title, 'RELEASE') + run: | + git tag $(python release.py --version_check) - name: Build wheels run: | $MAMBA_EXE create -n cibuildwheel python=3.12 eigen pybind11=3.0.1 diff --git a/release.py b/release.py index b815aff7..69012ed2 100644 --- a/release.py +++ b/release.py @@ -17,7 +17,7 @@ def main(): if args.version_check: file_ver, _ = _version_check() - print(f'Version string "{file_ver}" in files match') + print(file_ver) token = args.token if token is None and 'GITHUB_TOKEN' in os.environ: @@ -44,7 +44,7 @@ def release_github(test=True, create_tag=False, token=None): elif git_ver != file_ver: raise Exception(f'version mismatch! __version__: {git_ver}; files: {file_ver}') - desc = re.search('# \[v[0-9\.]*\]\(http.*?\)\n(.*?)# \[v[0-9\.]*\]', changelog, + desc = re.search(r'# \[v[0-9\.]*\]\(http.*?\)\n(.*?)# \[v[0-9\.]*\]', changelog, re.DOTALL | re.MULTILINE).groups()[0].strip() payload = { "tag_name": git_ver, @@ -61,7 +61,7 @@ def release_github(test=True, create_tag=False, token=None): if not upload_url: upload_url = _create_gh_release(payload, token) else: - upload_url = re.search('^(.*)\{\?', upload_url).groups()[0] + upload_url = re.search(r'^(.*)\{\?', upload_url).groups()[0] _upload_assets(upload_url, token) @@ -125,7 +125,7 @@ def _version_check(): changelog = f.read() with open('CITATION.cff') as f: citation = f.read() - cl_ver = re.findall('# \[(.*)\]\(http', changelog)[0] + cl_ver = re.findall(r'# \[(.*)\]\(http', changelog)[0] cit_ver = 'v' + re.findall('\nversion: "(.*)"', citation)[0] if cl_ver != cit_ver: raise Exception(f'version mismatch! CHANGELOG.md: {cl_ver}; CITATION.cff: {cit_ver}') @@ -142,7 +142,7 @@ def _create_gh_release(payload, token): print(response.text) if response.status_code != 201: raise RuntimeError('Could not create release') - upload_url = re.search('^(.*)\{\?', json.loads(response.text)['upload_url']).groups()[0] + upload_url = re.search(r'^(.*)\{\?', json.loads(response.text)['upload_url']).groups()[0] return upload_url From 29e192639c4cb074447e718a6be1c3826f86ace5 Mon Sep 17 00:00:00 2001 From: Duc Le Date: Sun, 26 Apr 2026 04:06:42 +0100 Subject: [PATCH 7/7] Remove CI run on release publishing --- .github/workflows/build_python.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml index 3e04541b..6951b7ce 100644 --- a/.github/workflows/build_python.yml +++ b/.github/workflows/build_python.yml @@ -7,8 +7,6 @@ on: pull_request: branches: [main] types: [opened, reopened, synchronize] - release: - types: [published] workflow_dispatch: concurrency :