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

Update basicsim.py #214

Merged
merged 5 commits into from
Jan 28, 2025

Conversation

marquezj
Copy link
Contributor

This test checks for coherent scattering physics for NCrystal materials in OpenMC.

@tkittel
Copy link
Member

tkittel commented Jan 24, 2025

Thanks @marquezj !

So since we didn't have the in-person meeting about the new development tools yet, here is how to quickly run some checks locally before pushing. First of all, you probably want to add ./devel/bin to your PATH so you get the new ncdevtool command (you can simply source ./devel/setup.sh which does this for you):

. ./devel/setup.sh

Now you can launch ncdevtool checks for some very fast code checks. However, since this is a development branch, I currently have a few fixme's left in the code which will cause the fixme check to fail. So try everything except that (the fixme check is only run in the CI workflow named fixme, so it does not cause other spurious failures):

ncdevtool check -n fixme

That is most likely all you need since you are just adding a python test script, but for reference here are a few other commands that one could in general use to check before pushing:

  • ncdevtool cmake (builds with CMake and runs ~100 tests with CTest)
  • ncdevtool sb -t (builds with simplebuild and launches tests)

In devel/reqs you can find environment files for conda and pip with all dependencies.

In this particular case, the ncdevtool check -n fixme complains that you have too many trailing empty lines in the file you added.

@tkittel
Copy link
Member

tkittel commented Jan 24, 2025

Btw., I can tell that I have to fix something so that the access token we use to get the openmc data is also available in PRs. Otherwise the openmc workflow will always fail in PRs.

@tkittel tkittel added openmc tests unit tests and CI setup labels Jan 24, 2025
@tkittel
Copy link
Member

tkittel commented Jan 24, 2025

Hmm... it is a bit complicated security wise. I think for the short term we might have to live without the openmc job succeeding in PRs, perhaps we can find a fix later.

@marquezj marquezj force-pushed the ncrystal_openmc_test branch from e85282e to eae6bf0 Compare January 27, 2025 11:43
@tkittel
Copy link
Member

tkittel commented Jan 27, 2025

To save you some time, you should try to run ncdevtool check -n fixme before pushing, since it fails with:

Run ./devel/bin/ncdevtool check -n "fix""me"
Trailing spaces at end-of-line found in /home/runner/work/ncrystal/ncrystal/devel/openmc/basicsim.py

Additionally, could you rename TRUE_ to REF_ in your variable names? The latter seems a bit less omniscient ;-)

@tkittel
Copy link
Member

tkittel commented Jan 27, 2025

The openmc CI jobs ran succesfully, which is nice. However, could you add a few more printouts when you are performing tests versus the reference, etc. Because the log file just ends with:


 ============================>     RESULTS     <============================

 Leakage Fraction            = 0.99334 +/- 0.00003

which makes one wonder if there were any checks at all (I guess there were, but without a printout it is hard to tell if the code by mistake aborted too early or what).

@marquezj marquezj force-pushed the ncrystal_openmc_test branch from bf248c9 to c2317d3 Compare January 28, 2025 14:37
@tkittel tkittel merged commit b214422 into mctools:tk_reorder_pyproject Jan 28, 2025
56 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmc tests unit tests and CI setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants