-
Notifications
You must be signed in to change notification settings - Fork 339
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
Formulary Documentation: Adding Missing Formulas to Docstrings #1041
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1041 +/- ##
==========================================
+ Coverage 96.21% 96.86% +0.65%
==========================================
Files 60 70 +10
Lines 5417 6864 +1447
==========================================
+ Hits 5212 6649 +1437
- Misses 205 215 +10 ☔ View full report in Codecov by Sentry. |
If I remember correctly, the functions call the ClassicalTransport methods and not the other way around; I would suggest bluntly referencing the ones with the actual implementation (e.g. "Wraps classicaltransport.this_method") from the wrappers :) |
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.
Good stuff! One note, though :)
@StanczakDominik - Hi, Dominik. Thank you for reviewing this PR. I made the changes you suggested in |
One worry I have about that is that if this works as I remembered and one calls the other, changing - for whatever possible reason, suppose we made a mistake and were off by sqrt2 for concreteness - one implementation will propagate changes in results, but not the documentation, into the other. I know I could and likely would easily forget that, which is why I advocated for the But it's a worry I can live with, I think. I can get you a review sometime after breakfast :) |
@StanczakDominik - Good point. I am not very familiar with wrappers, so maybe you could suggest some code for that. But perhaps this problem will end up being moot in the future if some significant refactoring of Also, forgot to mention, but I plan to add formulas to the docstrings in |
Gah, I'm sorry, that turned out to be a off-by-one-breakfast error combined with a wrong meal bug... getting to it now! When I say "wrapper", I mean something like how this: PlasmaPy/plasmapy/formulary/braginskii.py Lines 740 to 794 in 6a161f0
is a very thin wrapper for this: PlasmaPy/plasmapy/formulary/braginskii.py Lines 457 to 491 in 6a161f0
Though yeah, I think any refactor we'd make here would start by deprecating the heck out of these functions, as - looking at this for the first time in a while - that's just terrible design 😅 |
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.
The docstrings look good, I'd be happy to merge it now, but I figured I'd wait and see if you want to discuss the comments a little :) If not (future PRs, and stuff), just say so and I can hit merge any time.
Calculate the thermal conductivity for ions. | ||
|
||
The ion thermal conductivity (:math:`\kappa`) of a plasma is defined by |
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.
Just a thought - one key piece of intuition I was missing while reviewing these three years ago was the understanding that the way these are defined is a transport law like
So yeah, despite wondering a little about the word "defined", I think this is a good change, but I wonder whether we shouldn't rewrite the docs for the whole transport module a little, to account for that...
gah, of course we should do that, we should take a hammer to the whole thing, after all. I'll make a note to do that when we refactor it.
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.
But at the same time, those transport laws are very general and don't necessarily apply only to classical transport. So it might be a moot point.
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.
Interesting points. We could change "defined" if users or contributors might be confused by this term. Perhaps something like "... is related by the formula ..." or "This function computes ... by the formula ...". But I think that we should discuss this and figure this out in an Issue or Discussion so that the documentation can be standardized.
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.
Good point, let's come back here from #1044 later :)
…, no need to run the precommit in this other directory I cloned...
That should do it, merging! Thanks, @Tiger-Du :) |
docstrings.
This PR is for Issue #935.
I went through the documentation of
plasmapy.formulary
, and from what I can tell, outside ofplasmapy.formulary.braginskii.py
, the only two (user-facing) functions that lack formulas aredimensionless.quantum_theta
anddimensionless.beta
. These quantities are simple ratios, but I believe they still should get complete documentation. Formulas for these two functions are added in this PR.I plan to add formulas to the docstrings in
braginskii.py
in this PR although these may be more complicated to document because of multiple supported models of classical transport.On a related note, I am not sure whether the methods of classes, such as the Classical Transport class in
braginskii.py
, should be documented in the same way (or at all) as standalone / free functions, and I would like to hear what other contributors think.