Open yakutovicha opened 11 months ago
Hi @yakutovicha and @GeorgHeld,
It's been a little over a week since we spoke about incorporating phase shift calculations within cleedpy
so I thought I'd give you an update from my side.
I've spent the interim improving the phaseshifts GitHub project, focusing on tackling the issues Georg mentioned, namely:
Compiling - I have updated libphsh.f
(click for diff) to appease modern gcc-11 and classic flang (i.e. fortran clang) open-source compilers commonly found on Ubuntu and Mac OS systems so that it can be compiled as part of binary wheel distributions to PyPI
[!CAUTION]
- I've identified several issues, with the most important one being that the compiled
phaseshifts.lib.libphsh
python extension is potentially not thread-safe (see https://github.com/Liam-Deacon/phaseshifts/issues/6), and the second one being that there are no tests to check that the generated phase shift values are appropriate (tracked via https://github.com/Liam-Deacon/phaseshifts/issues/16). If concurrency is what is needed (or running on Windows - via WSL) then for now a workaround can be done by using the published docker image - see latest documentation on running phsh.py[!WARNING]
- There are also issues compiling on Python 3.8 (https://github.com/Liam-Deacon/phaseshifts/issues/67) and 3.12 (https://github.com/Liam-Deacon/phaseshifts/issues/8) so for now if someone needs to use those python versions then they must compile from the source distribution. Windows is completed unsupported at this time due to DLL load issues (see https://github.com/Liam-Deacon/phaseshifts/issues/32)
[!NOTE] As part of updating the documentation I did a literature search for alternatives... The phaseshifts package is not the only python codebase derived from the Barbieri / Van Hove phshift2007 package - since creating the package in 2014, AQuaLEED was released and might be worth a look!
The process of publishing documentation and uploading new python wheels on release are now all automated and things such as testing new changes, code coverage, static analysis and pre-commit style checks are all performed as part of continuous integration checks on pull requests with the idea to nudge towards good practices going forward 🤞
[!TIP] What this means is that it is possible to
pip install phaseshifts
on Linux and Mac for most common CPU types and modern python versions. Should this not be possible then it is possible to usedocker run ghcr.io/liam-deacon/phaseshifts:latest
to invokephsh.py
without needing a compatible python environment on the local machine.
[!NOTE]
- I am tracking items that inhibit use of phaseshifts as a package under https://github.com/Liam-Deacon/phaseshifts/issues/17
Any feedback (especially issues) or suggestions would be most appreciated 🙏
Thanks,
Liam
Thanks a lot, @Liam-Deacon, for the detailed write-up. We will return to this issue once the basic functionalities of the cleepdy package are in place.
Instead of relying on pre-computed phase-shifts, we should embed the phase-shift program into
cleedpy
and compute them on the fly.