Add docstrings for modules/classes/methods#325
Conversation
255ebd6 to
32b0b48
Compare
|
awesome! it will take some time to review though... 👀 |
|
I've added a commit to reformat all files to fit my style preference, that is, triple quotes always alone on a new line, and empty line after module docstring:
I don't have strong feelings regarding the other rules. anyway, automatically fixed with: |
|
moved |
| @@ -406,23 +474,18 @@ def _get_ohmic_parameters( | |||
| efittime : array_like | |||
| The times at which the inductance was measured. | |||
There was a problem hiding this comment.
Is it accurate to say the time from li, efittime = params.mds_conn.get_data_with_dims( r"\efit_aeqdsk:li", tree_name="_efit_tree", astype="float64" ) is a measurement time?
There was a problem hiding this comment.
There was a problem hiding this comment.
not really, I'd say it's the "time at which the internal inductance was computed using EFIT".
There was a problem hiding this comment.
All EFIT parameters share the same time array so it shouldn't be "computed specifically for li". I'd just say "The EFIT time array/base (for the given shot)"
| efittime : array_like | ||
| The times at which the inductance was measured. | ||
| dip_smoothed : array_like | ||
| The smoothed plasma current. |
There was a problem hiding this comment.
smoothed signal of the measured plasma current.
yumouwei
left a comment
There was a problem hiding this comment.
I went through all of the changes and didn't notice any explicit problem, so I'd say we can merge this.
|
|
||
| @staticmethod | ||
| def __get_te_profile_params_ece( | ||
| def _get_te_profile_params_ece( |
Problem
The code lacked significant portions of documentation which reduces code readability and long-term maintainability. Pylint picked up the places lacking documentation.
Relevant pylint codes:
C0114 missing-module-docstring
C0115 missing-class-docstring
C0116 missing-function-docstring
Proposed solution
I used the following prompt for duck.ai (GPT-4o)
Please provide really concise and appropriate docstrings (module, class, and method) for the following code without changing any logic. Docstrings should follow Numpy standardsand then I went though and revised them all.Needs review:
Additional notes:
SharedInstanceFactory-->SharedInstancebecause I think it more closely follows a singleton design pattern rather than a factory design pattern._get_n_equal_1_amplitudebecause it has no functionality at the moment and we will revise the separation of fetching and calculating latermodule_file_path_fin conftest.py because it is literally the same code astest_file_path_f[EDIT by GLT: I added pylint ignore comments for the few issues here below.]
Obstacles to removing all instances of these Pylint error codes:
Channeland I wasn't sure what to put as a docstring for them. I could write "Data Channel" but that does not help improve readabilitymultiprocessing.pyunder the assumption it will soon be removedTest with
make pylint-only CODE=C0114,C0115,C0116