-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Edit docstring in run_tardis
#1723
Edit docstring in run_tardis
#1723
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1723 +/- ##
=======================================
Coverage 61.88% 61.88%
=======================================
Files 63 63
Lines 5851 5851
=======================================
Hits 3621 3621
Misses 2230 2230
Continue to review full report at Codecov.
|
tardis/base.py
Outdated
log_state : str, optional | ||
Set the level of the TARDIS logger. (Default level of the logger is set to CRITICAL.) | ||
specific : bool, optional | ||
If True, only show the log messages from a particular log level, set by `log_state`. |
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.
Explain what happens if set to False.
tardis/base.py
Outdated
virtual_packet_logging : bool, default False, optional | ||
Option to enable virtual packet logging. | ||
log_state : str, optional | ||
Set the level of the TARDIS logger. (Default level of the logger is set to CRITICAL.) |
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.
List options for this argument.
tardis/base.py
Outdated
@@ -1,4 +1,4 @@ | |||
# functions that are important for the general usage of TARDIS | |||
"""Functions that are important for the general usage of TARDIS.""" |
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.
let's keep this as a regular comment.
314a6f5
to
3cd8c61
Compare
Before a pull request is accepted, it must meet the following criteria:
|
3cd8c61
to
d3f2d79
Compare
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.
Thanks for doing this necessary thing - there are few things I've commented.
Also make sure to get this merged first and then rebase #1636
tardis/base.py
Outdated
[[callback1, callback_arg1], [callback2, callback_arg2], ...] | ||
Where the callback function signature should look like: | ||
callback_function(simulation, extra_arg1, ...) | ||
virtual_packet_logging : bool, default False, optional |
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.
Not sure if you can write default values in parameter type, they should be in parameter description AFAIR
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'm afraid the examples mentioned here have the default values next to parameter type, that's why I used it.
I didn't follow that convention in #1636 and I will fix it ASAP. Pandas
also follows the NumPy
style guide, it seems they did the same too.
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.
Oh, I see so numpydoc says both are valid (in type or in description). Thanks for linking up examples
If you're keeping it in type then do it throughout the module - when there are options we should follow one option consistently since that will enhance readability
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 agree with Jaladh. We should have consistent docstring formats throughour the whole Project.
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.
default: False
like you did below
tardis/base.py
Outdated
log_state : str, optional | ||
Set the level of the TARDIS logger. Options include `NOTSET`, `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`. | ||
Default level of the logger is set to CRITICAL. | ||
specific : bool, optional |
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.
See this - you are also breaking consistency by mentioning some default values in parameter type - let's keep all in description
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 default value of the argument in the function is None
, but that of the logger is actually CRITICAL
, which is set here I believe. I guess moving this to the parameter section would mean that the default argument is CRITICAL
, but it's actually None
.
Maybe it would be a good idea to mention that the default value is set here?
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.
Then add default: None here and explain in description what does none imply
e2674f0
to
ba488dd
Compare
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.
It looks better than before but I have some concerns regarding the log_state
argument definition.
ba488dd
to
ca82574
Compare
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.
Thanks for updates. These are small change requests but please pay attention to details - you're missing the point of consistency that I mentioned earlier (so that you don't have to redo it 😄 )
Please let me know if there are any doubts
tardis/base.py
Outdated
The default value of the argument is `None` but the default level | ||
of the logger is `CRITICAL`. |
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 confusing to even me. You just need to tell what happens to logging when this parameter is set to None, let me know if it is still unclear?
@DhruvSondhi can you help him out?
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 is actually correct because the default value is being set via the YAML parameter. It is a little complicated. @jaladh-singhal please do discuss this with me.
tardis/base.py
Outdated
packet_source : class, optional | ||
A custom packet source class or a child class of `tardis.montecarlo.packet_source` | ||
used to override the TARDIS `BasePacketSource` class. | ||
simulation_callbacks : list of lists, optional |
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.
Default value missing in type, also we need description what empty list does
tardis/base.py
Outdated
[[callback1, callback_arg1], [callback2, callback_arg2], ...] | ||
Where the callback function signature should look like: | ||
callback_function(simulation, extra_arg1, ...) | ||
virtual_packet_logging : bool, default False, optional |
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.
default: False
like you did below
ca82574
to
915a791
Compare
Can you please share the preview link for the documentation? |
Sure, could you please check this out? |
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.
Looks good to me - you just need to rebase it and rename log_state
to log_level
(#1730)
915a791
to
e102585
Compare
* edit docstring in run_tardis * [build docs]
* edit docstring in run_tardis * [build docs]
* edit docstring in run_tardis * [build docs]
* edit docstring in run_tardis * [build docs]
This edits the docstring in
run_tardis
function.Description
The docstrings in
run_tardis
functions are incomplete and need to be edited.Motivation and context
Resolves #1719
How has this been tested?
Examples
Link to the API documentation
Type of change
Checklist