-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add single model evaluation example notebook #3553
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3553 +/- ##
==========================================
- Coverage 31.55% 31.18% -0.37%
==========================================
Files 82 83 +1
Lines 19565 20024 +459
==========================================
+ Hits 6173 6245 +72
- Misses 13392 13779 +387 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of issues probably caused by different versions of Jupyter/matplotlib.
Is it worth noting somewhere that this notebook will only become easier as the Pythonisation continues? I'm in two minds, and I'll leave that up to you.
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"pdivt = 42.364607206184246\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 0
? Does the notebook need to be re-run from scratch and re-pushed?
"source": [ | ||
"def run_impurities(w_imp_fracs):\n", | ||
" \"\"\"Calculate responses to W impurities.\"\"\"\n", | ||
" n = w_imp_fracs.shape[0]\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think commenting that n
here is the number of times we change the W frac and observe the responses helps make this clearer quicker.
" p_plasma_rad_mw = np.empty(n)\n", | ||
" pdivt = np.empty(n)\n", | ||
" p_l_h_threshold_mw = np.empty(n)\n", | ||
" con15 = np.empty(n)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to do this, or can we just make these as normal arrays and append the values?
Then comment on the loop that we are iterating over the W frac test points and storing key physical responses at each test point.
"ax.set_title(\"W impurity fraction against radiated and divertor power\")\n", | ||
"ax.set_xlabel(\"W impurity fraction\")\n", | ||
"ax.set_ylabel(\"Power (MW)\")\n", | ||
"ax.legend()" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't work for me without adding %matplotlib inline
to the top of the cell
"ax.set_ylabel(\"L-H threshold constraint value\")\n", | ||
"ax.hlines(0.0, xmin=ax.get_xlim()[0], xmax=ax.get_xlim()[1], colors=\"r\")\n", | ||
"ax.annotate(\"Satisfied\", (0.0, 0.1))\n", | ||
"ax.annotate(\"Violated\", (0.0, -0.15))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, figures did not display until %matplotlib inline
@@ -62,3 +62,4 @@ python_modules.txt | |||
quench_data.DAT | |||
env-fork | |||
*SIG_TF.json | |||
!examples/data/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!examples/data/* | |
!examples/data/*IN.DAT |
Otherwise the MFILE and OUT file become untracked when they should not be
Add an example notebook demonstrating single-model evaluation in Process, without using the CLI and input/output files.