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

Bug in Stark maps intoduced by recent updates #15

Closed
nikolasibalic opened this issue May 24, 2018 · 4 comments
Closed

Bug in Stark maps intoduced by recent updates #15

nikolasibalic opened this issue May 24, 2018 · 4 comments

Comments

@nikolasibalic
Copy link
Owner

nikolasibalic commented May 24, 2018

I am aware that recent updates introduced some bug to calculation of Stark maps and possibly more. Stable version is 1.3. I am working to resolve this ASAP.

@nikolasibalic
Copy link
Owner Author

nikolasibalic commented May 24, 2018

Problem is due to removed file arc/data/precalculated_stark.db in commit 2ae9015 . This impacts only Stark map calculations.
This file should be included in distribution for performance, and will be in future. However, even when it's not included, it should be created new correctly. I am looking now why is this not the case.

nikolasibalic added a commit that referenced this issue May 24, 2018
@nikolasibalic
Copy link
Owner Author

nikolasibalic commented May 24, 2018

pypi package version 1.4.3 fixes temporarily this bug by including the required databases. To apply this fix do
rm -rf ~/.arc-data
pip install ARC-Alkali-Rydberg-Calculator --upgrade --no-cache-dir

I am working to figure out what is causing the underlying problem of not generating this database elements correctly if they are not provided.

@nikolasibalic
Copy link
Owner Author

nikolasibalic commented May 24, 2018

Underlying reason has to do with differences between Python 3 and Python 2. Under Python 2.7 new arc/data/precalculated_stark.db is created with correct values. But under Python 3 something is miscalculated. I am guessing it has to do with different treatment of float/int. Looking into more details now.

@nikolasibalic
Copy link
Owner Author

Problem was different behaviour of round function when rounding half-integers in Python 2 and Python 3. See for example this. This was causing problems in retriving memorized precalculated Winger3j in arc/wigner.py module, since round function was used for obtaining matrix index precisely for half integer values of j. Problem resulted in incorrect results under Python 3 (Python 2 was fine). This was resolved in eec2918 through introduction of roundPy2 function that has same rounding behaviour both in Python 2 and Python 3.

Bug could affect calculations under Python 3. The updated pip package version 1.4.5. fixes this, and it's available for download now. You can apply the update by:
rm -rf ~/.arc-data
pip install ARC-Alkali-Rydberg-Calculator --upgrade --no-cache-dir

This should install new version (1.4.5 or higher) of package under Linux, Windows and Mac. (NOTE: first line is for removing hidden data folder cache stored in user's home directory. Under Windows it might be different command)

nikolasibalic added a commit that referenced this issue Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant