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

mspectrum raises NotImplementedError on macOS #154

Open
ghost opened this issue Aug 20, 2017 · 6 comments
Open

mspectrum raises NotImplementedError on macOS #154

ghost opened this issue Aug 20, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 20, 2017

When calling mspectrum() on macOS (10.12.6, python3.6) the NotImplementedError is raised.
It seems to be a multiprocessing module dependent error, since calling the qsize() method might fail under macOS.

NotImplementedError                       Traceback (most recent call last)
<timed exec> in <module>()

/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ChiantiPy-0.7.dev534-py3.6.egg/ChiantiPy/core/Mspectrum.py in __init__(self, temperature, eDensity, wavelength, filter, label, elementList, ionList, minAbund, keepIons, abundance, doContinuum, allLines, em, proc, verbose, timeout)
    162                 ionWorkerQ.put((akey, temperature, eDensity, wavelength, filter, allLines, abundance, em, doContinuum))
    163         #
--> 164         ffWorkerQSize = ffWorkerQ.qsize()
    165         fbWorkerQSize = fbWorkerQ.qsize()
    166         ionWorkerQSize = ionWorkerQ.qsize()

/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/queues.py in qsize(self)
    115     def qsize(self):
    116         # Raises NotImplementedError on Mac OSX because of broken sem_getvalue()
--> 117         return self._maxsize - self._sem._semlock._get_value()
    118 
    119     def empty(self):

NotImplementedError: 
@kdere
Copy link
Contributor

kdere commented Aug 21, 2017

This is another sign of some of the problems with the continuum routines as in issue #155 and I am working to correct them. In the meantime, there is the v 0.7.0 release that works but the continuum calculations are not as good as in the current version, when I get it working again.

@wtbarnes
Copy link
Member

wtbarnes commented Aug 29, 2017

I wonder if this is fixed by #157 as well? The source of this error is much less obvious to me...
See comment below

@wtbarnes
Copy link
Member

@Astroprog could post the exact code snippet that led to this error?

@wtbarnes
Copy link
Member

@kdere I'm pretty sure this is just a consequence of executing the qsize() method on Mac OS as indicted by the comment in the Traceback,

# Raises NotImplementedError on Mac OSX because of broken sem_getvalue()

The only option I think would be to find a different way of getting the queue size, at least on OS X. There is a similar issue here: vterron/lemon#11

@kdere
Copy link
Contributor

kdere commented Aug 30, 2017

Try running the calculation without calculating the continuum. The spectral line intensities calculations have not changed and this may tell us something

@kdere
Copy link
Contributor

kdere commented Aug 31, 2017

I just did this myself and the calculation worked for me.
temp=2.e+7 dens=1.e+9 wvl=1. + 0.002*arange(4501) import ChiantiPy.tools.filters as chfilters s3 = ch.spectrum(temp, dens, wvl, filter = (chfilters.gaussian,.015),doContinuum=0, em=1.e+27,minAbund=1.e-5,verbose=1,nproc=4)
because I was only working with the line intensities, neither ffworkerQ nor fbworkerQ are used. I suspect that is has not been tested this way. I think I have always calculated the ions and may or may not have calculated the continuum. I will try this once the continuum code gets working again.

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

No branches or pull requests

2 participants