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

Discrepancy in Decay Calculation Between Linux and MacOS #1539

Open
ahnaf-tahmid-chowdhury opened this issue May 17, 2024 · 1 comment
Open

Comments

@ahnaf-tahmid-chowdhury
Copy link
Member

Description

While testing test_material.py on MacOS, it was observed that Nd144 with a value of 8.996484819074119e-40 is dropped when calling pyne.Material({"U235": 1.0, "H3": 1.0}).decay(365.25 * 24.0 * 3600.0). This behavior is specific to MacOS, as the same calculation works correctly on Linux. This discrepancy is causing the test to fail on MacOS.

Steps to Reproduce

  1. Create a Material instance with {"U235": 1.0, "H3": 1.0}.
  2. Call the decay method with 365.25 * 24.0 * 3600.0 as the argument.
  3. Observe that Nd144 is dropped in the resulting Material on MacOS, while it is retained on Linux.

Expected Behavior

The decay method should produce consistent results across different operating systems, retaining all isotopes including those with very small values such as Nd144 with 8.996484819074119e-40.

Actual Behavior

On MacOS, Nd144 is dropped from the resulting Material, whereas on Linux, it is retained. This inconsistency causes the test to fail on MacOS.

Environment

  • MacOS Version: macos-latest
  • Linux Version: ubuntu-latest
  • PyNE Version: scikit-build-core
  • Python Version: 3.12

Logs

For more details, refer to the Workflow logs.

Additional Information

The issue appears to be related to how very small values are handled in the decay process on MacOS. Further investigation is required to determine the root cause and to implement a fix that ensures consistency across all platforms.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

After setting decay(1000 * 365.25 * 24.0 * 3600.0), the macOS test passed. More info can be found here. It seems that when the value is 1e-40, it gets ignored, but 1e-38 works on macOS.

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

When branches are created from issues, their pull requests are automatically linked.

1 participant