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

fix: Adding non-default loggables explicitly. #1331

Merged
merged 11 commits into from May 31, 2022

Conversation

b-butler
Copy link
Member

@b-butler b-butler commented May 17, 2022

Description

Fixes #1328, by adding force_quantities to internal loggable filtering.

Motivation and context

Resolves #1328

How has this been tested?

A test will be added soon.

Change log

Fixed: Non-default loggables can now be explicitly specified using Logger.add.

Checklist:

Now `hoomd.logging.Logger.add` will add non-default loggables when
explicitly asked.
@b-butler b-butler requested review from a team as code owners May 17, 2022 15:19
@b-butler b-butler requested review from tommy-waltmann and cbkerr and removed request for a team May 17, 2022 15:19
Copy link
Contributor

@tommy-waltmann tommy-waltmann left a comment

Choose a reason for hiding this comment

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

There is a small fix in the tests here, but I would like to see some more complete tests for the Logger class's behavior.

hoomd/pytest/test_logging.py Outdated Show resolved Hide resolved
@joaander joaander added the validate Execute long running validation tests on pull requests label May 25, 2022
Copy link
Contributor

@tommy-waltmann tommy-waltmann left a comment

Choose a reason for hiding this comment

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

Just one small question, then this should be ready to merge.

hoomd/pytest/test_table.py Show resolved Hide resolved
@joaander
Copy link
Member

@cbkerr, please review.

Copy link
Member

@cbkerr cbkerr left a comment

Choose a reason for hiding this comment

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

I had trouble reviewing because I couldn't parse the docstrings. I made a commit with my re-interpretation of them. Please correct if it's wrong.
One problem is that "pass over" can mean "skip, don't give to logger" or "give to the logger"

I think the logic in the tests makes sense

hoomd/logging.py Outdated
logged by "default", defaults to ``True``. This mostly means that
performance centric loggable quantities will be passed over when
logging when false.
logged by "default". Defaults to ``True``. If ``False``, loggable
Copy link
Member

Choose a reason for hiding this comment

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

Why the quotes on by "default"?
Where is this "default" specified?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is specified by the specific loggable. We could use italic. I was just trying to emphasize the word.

Copy link
Member

Choose a reason for hiding this comment

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

I think emphasizing it is confusing because the parameter also contains "default". Would we lose much by omitting this bit?

hoomd/logging.py Outdated
``only_default`` flag is mainly a convenience by allowing quantities not
commonly logged (but available) to be passed over unless explicitly asked
for. You can override the ``only_default`` flag by explicitly listing the
``only_default`` flag affects performance by controlling whether available
Copy link
Member Author

@b-butler b-butler May 27, 2022

Choose a reason for hiding this comment

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

@cbkerr only_default doesn't really effect performance. It is just to prevent quantities that may not be commonly desired from automatically being added on Logger.__iadd__ and Logger.add.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah I see the documentation was completely misleading here... I think I meant show not slow...

@b-butler b-butler requested a review from cbkerr May 27, 2022 15:30
@joaander
Copy link
Member

@cbkerr Let us know if these changes addressed your comments.

Copy link
Member

@cbkerr cbkerr left a comment

Choose a reason for hiding this comment

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

The extra details in the docstrings help

Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Fix readthedocs and precommit failures.

@cbkerr
Copy link
Member

cbkerr commented May 31, 2022

The RTD failure came from the auto upgrade to 5.0.0 sphinx-doc, specifically:

#10474: language does not accept None as it value. The default value of language becomes to 'en' now.

@joaander joaander enabled auto-merge May 31, 2022 16:36
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks!

@joaander joaander merged commit 66a7248 into trunk-patch May 31, 2022
@joaander joaander deleted the fix/default-loggables branch May 31, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants