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

The function is_stable() is misnamed. #219

Open
karnigen opened this issue Dec 20, 2024 · 1 comment
Open

The function is_stable() is misnamed. #219

karnigen opened this issue Dec 20, 2024 · 1 comment

Comments

@karnigen
Copy link

karnigen commented Dec 20, 2024

I believe there is a naming inconsistency with the function is_stable(). Currently, it returns true for unstable nuclides, which is counterintuitive. A more logical behavior would be to return true for stable nuclides and false for unstable ones.

I suggest renaming the function to is_unstable() to better reflect its current behavior. Alternatively, we could keep the name is_stable() but invert the return values.

Python is_stable() wraps c++ isStable() that simply returns STA of MF=1 MT=451.
Meaning of STA from ENDF documentation 1.1.

STA Target stability flag:

  • STA=0, stable nucleus;
  • STA=1 unstable nucleus. If the target is unstable, radioactive decay data should be given in the decay data sub-library (NSUB=4).

The isStable() function returns true for stable nuclids for MF=8 MT=457, as expected (returns NST).
It's counterproductive to receive inconsistent results from the same function in different environments.

@whaeck
Copy link
Member

whaeck commented Jan 20, 2025

My apologies for replying so late on this issue, but I have been on vacation since December 17 till today and I did not have access to my professional email during that period.

On to the issue at hand: you are correct, the STA variable is being incorrectly interpreted in the current release version of ENDFtk. This specific problem has been addressed in the current develop version (see PR #205). To summarise, the following changes were made in that particular PR:

  • the STA() function in C++ and STA property in Python still returns the value of the stability flag
  • an isUnstable() function in C++ and is_unstable property in Python has been added and returns true for unstable nuclides
  • isStable() now returns the result of ! isUnstable()

We should be releasing a new version of ENDFtk that provides a large number of updates and a few minor interface changes and corrections (including this particular one) soon. For a full overview of all changes, you can look here: https://github.com/njoy/ENDFtk/blob/develop/ReleaseNotes.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants