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

Make IPython and IParallel optional #3145

Merged
merged 5 commits into from Jul 14, 2023

Conversation

ericpre
Copy link
Member

@ericpre ericpre commented May 7, 2023

Progress of the PR

  • Make ipyparallel and ipython optional dependencies,
  • Fix behaviour of some print_* functions, which were not printing when running from a script, they were only printing when running in notebook or qtconsole. Now all print_* functions behave consistently: they all print the output and doesn't return an object, which was an str or html. The ipython display will pick the correct rendering when running in an "ipython" context, for example notebook, qtconsole.
  • Remove fancy to some print_* functions, which wasn't doing anything,
  • Bump prettytable to 2.3 to simplify code,
  • update docstring (if appropriate),
  • update user guide (if appropriate),
  • add an changelog entry in the upcoming_changes folder (see upcoming_changes/README.rst),
  • Check formatting changelog entry in the readthedocs doc build of this PR (link in github checks)
  • add tests,
  • ready for review.

Minimal example of the bug fix or the new feature

To test the print_* funtions:

import hyperspy.api as hs

hs.print_known_signal_types()

s = hs.datasets.example_signals.EDS_TEM_Spectrum()
m = s.create_model()
m.print_current_values()

@ericpre ericpre changed the title Ipython optional Make IPython and IParallel optional May 7, 2023
@codecov
Copy link

codecov bot commented May 7, 2023

Codecov Report

Patch coverage: 92.00% and project coverage change: +0.12 🎉

Comparison is base (cc03d73) 81.23% compared to head (abd7004) 81.36%.

Additional details and impacted files
@@                  Coverage Diff                   @@
##           RELEASE_next_major    #3145      +/-   ##
======================================================
+ Coverage               81.23%   81.36%   +0.12%     
======================================================
  Files                     176      176              
  Lines                   24409    24406       -3     
  Branches                 5683     5681       -2     
======================================================
+ Hits                    19829    19857      +28     
+ Misses                   3274     3244      -30     
+ Partials                 1306     1305       -1     
Impacted Files Coverage Δ
hyperspy/misc/ipython_tools.py 16.36% <0.00%> (+1.36%) ⬆️
hyperspy/utils/parallel_pool.py 83.33% <88.00%> (+22.46%) ⬆️
hyperspy/_signals/eels.py 77.61% <100.00%> (ø)
hyperspy/component.py 90.52% <100.00%> (-0.05%) ⬇️
hyperspy/misc/model_tools.py 95.12% <100.00%> (ø)
hyperspy/misc/utils.py 91.49% <100.00%> (-0.02%) ⬇️
hyperspy/model.py 86.69% <100.00%> (-0.05%) ⬇️
hyperspy/utils/__init__.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ericpre ericpre force-pushed the ipython_optional branch 2 times, most recently from ba002f3 to 6bca2a4 Compare May 7, 2023 08:41
@ericpre ericpre mentioned this pull request May 8, 2023
4 tasks
@CSSFrancis CSSFrancis mentioned this pull request May 15, 2023
57 tasks
@ericpre ericpre force-pushed the ipython_optional branch 2 times, most recently from e70b7ac to eae849f Compare May 18, 2023 17:45
@ericpre ericpre added this to the v2.0 Split milestone Jul 13, 2023
@jlaehne jlaehne merged commit 8ef1a73 into hyperspy:RELEASE_next_major Jul 14, 2023
25 checks passed
@ericpre ericpre deleted the ipython_optional branch July 14, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants