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

Verbosity improvements #1388

Merged
merged 10 commits into from
Oct 7, 2020
Merged

Conversation

RobinD42
Copy link
Contributor

@RobinD42 RobinD42 commented Oct 6, 2020

Fixes #1362
See also NanoComp/mpb#125

  • Make it possible to access the individual verbosity levels by name in the Verbosity class
  • Switch verbosity checks in Python code to verbosity.meep or verbosity.mpb
  • Make MPB's version numbers be accessible from Python in the meep.mpb package
  • When calling mpb code from meep code set mpb_verbosity to meep::verbosity - 1
  • Switch most mpb_verbosity checks to >=1, to be closer to the original intent of the new verbosity functionality
  • Added a unit test module for testing the Verbosity class

@RobinD42
Copy link
Contributor Author

RobinD42 commented Oct 6, 2020

NOTE: After playing with and testing this change for a couple days I'm not so sure that the feature of setting mpb_verbosity to meep::verbosity - 1 won't cause more confusion than it's worth. Maybe it won't happen often in real life usage, but it took me several minutes to realize why this wasn't working, and I'm the one who made the change:

verbosity.meep = 2
verbosity.mpb = 3
a_solver.run_te()

Since the mpb_verbosity was set to 1, I didn't see the messages I was expecting.

@stevengj
Copy link
Collaborator

stevengj commented Oct 6, 2020

After playing with and testing this change for a couple days I'm not so sure that the feature of setting mpb_verbosity to meep::verbosity - 1 won't cause more confusion than it's worth.

It should only be done in src/mpb.cpp, i.e. when MPB is called from Meep, and not when you are calling functions from pympb like run_te().

@RobinD42
Copy link
Contributor Author

RobinD42 commented Oct 6, 2020

Okay. I've reverted the applicable changes in pympb.cpp

@stevengj stevengj merged commit 5ceb8ca into NanoComp:master Oct 7, 2020
@RobinD42 RobinD42 deleted the verbosity-improvements branch October 7, 2020 01:07
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* Add ability to access verbosity values by name (as a property), moved test code to a unittest module.

* Add RAII class to temporarily set mpb_verbosity to meep's verbosity-1

* Make MPB's version available from Python

* Use adjust_mpb_verbosity in mpb.cpp and pympb.cpp at strategic points

* Update comments and some cleanup

* Remove some debug printf's

* Switch most mpb_verbosity checks to be >=1

* Switch verbosity checks in Python code to verbosity.meep or verbosity.mpb

* Revert use of adjust_mpb_verbosity in pympb, add a couple more in mpb

* adjust_verbosity.h does not need to be #included here any longer
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.

more verbosity tweaks
2 participants