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

Feature/log level input checking #119

Closed
wants to merge 4 commits into from

Conversation

calbaker
Copy link
Collaborator

No description provided.

@calbaker calbaker requested a review from kylecarow April 26, 2024 15:22
np.cumsum(
(pnts['time_local'] -
pnts['time_local'].shift()).fillna(pd.Timedelta(seconds=0)).astype('timedelta64[s]')
with fsim.utils.suppress_logging():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change instances of fsim.utils.suppress_logging(): to a single fsim.utils.disable_logging() at the top of the file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylecarow, I prefer the latter because I'd like it to be really obvious that we're suppressing logging so that we remember to fix the cause of the logging at some point in the future. Does this seem ok?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either way really. Do you mean keeping it as is?

err_str = f"Invalid arg: '{level}'. See doc string:\n{set_log_level.__doc__}"

assert level in allowed_args, err_str

if isinstance(level, str):
level = logging._nameToLevel[level]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@calbaker optionally:

Suggested change
level = logging._nameToLevel[level]
level = logging._nameToLevel[level.upper()]

This would allow lowercase log level strings "warning", "info", etc., but we would need to add those to the allowable inputs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylecarow , yea that sounds good. Could you make that change?

@calbaker calbaker closed this May 14, 2024
@calbaker
Copy link
Collaborator Author

moved to #126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants