usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

remove mass.demo #256

Closed joefowler closed 3 months ago

joefowler commented 1 year ago

Original report by Galen O'Neil (Bitbucket: oneilg, GitHub: oneilg).


It appears broken, it’s not tested, I don’t believe it’s been used in the last few years, and any content it has would be better placed in the doctests.

Below is my failed attempt to run it today on the truebq ubuntu machine:

Python 3.8.10 (default, May 26 2023, 14:05:08) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import mass.demo
m
This package (mass.demo) consist of several demonstration scripts.
To run one as an IPython demo, you say:

massdemo = mass.demo.demos['intro.py']
massdemo()
massdemo() # Each call to the Demo object moves forward 1 more block in the demo.
#      The basic intro.py has close to a dozen blocks to step through.
#      If you want to start over, in the middle or after completing the demo:
massdemo.reset()

The full list of available demos is:
('intro.py', 'fitting_demo.py', 'fitting_fluorescence.py', 'cuts.py', 'full_analysis_example.py')

In [2]: massdemo = mass.demo.demos["intro.py"]

In [3]: massdemo()
***************** Executing silent block # 0 (12 remaining) *****************
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
File ~/qsp/lib/python3.8/site-packages/IPython/lib/demo.py:450, in Demo.run_cell(self, source)
    447 def run_cell(self,source):
    448     """Execute a string with one or more lines of code"""
--> 450     exec(source, self.user_ns)

File <string>:21

ImportError: cannot import name 'sourceroot' from 'mass.demo' (/home/pcuser/qsp/src/mass/mass/demo/__init__.py)

In [4]: 

joefowler commented 3 months ago

This was actually fixed 9 months ago in 2d16a6c461118.