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

Lightcurve doesn't work with multithread #565

Open
astroSyvertHE opened this issue Feb 8, 2024 · 4 comments
Open

Lightcurve doesn't work with multithread #565

astroSyvertHE opened this issue Feb 8, 2024 · 4 comments

Comments

@astroSyvertHE
Copy link

Hi, I'm using the last fermipy version installed with mamba.
During light curve processes an error occurs. The command is:

lc = gta.lightcurve('4FGL J1243.2+3627',binsz=15768000,
multithread=True, nthread=8,
shape_ts_threshold = 16.0, use_scaled_srcmap=True,
make_plots = True, outdir='six_month',
free_background=False,
free_radius=3.0, free_params='norm')

And the error is:

2024-02-08 13:03:19 INFO GTAnalysis.lightcurve(): Computing Lightcurve for 4FGL J1243.2+3627
2024-02-08 13:03:19 WARNING GTAnalysis._make_lc(): Last lightcurve bin (2937604.0 s) is shorter than nominal (15768000.0 s).
Process SpawnPoolWorker-495:
Process SpawnPoolWorker-497:
Process SpawnPoolWorker-500:
Process SpawnPoolWorker-498:
Process SpawnPoolWorker-499:
Process SpawnPoolWorker-496:
Process SpawnPoolWorker-501:
Process SpawnPoolWorker-502:
Traceback (most recent call last):
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
Traceback (most recent call last):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Traceback (most recent call last):
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-503:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-504:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-505:
Process SpawnPoolWorker-506:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-507:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-508:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-509:
Process SpawnPoolWorker-510:
Traceback (most recent call last):
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-511:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-512:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-513:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-514:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-515:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-516:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-518:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-517:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-519:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-520:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-521:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-522:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-523:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-524:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)
Process SpawnPoolWorker-525:
Traceback (most recent call last):
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/pool.py", line 114, in worker
task = get()
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/multiprocessing/queues.py", line 367, in get
return _ForkingPickler.loads(res)
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/lightcurve.py", line 21, in
import fermipy.gtanalysis
File "/Users/sofiav/miniforge3/envs/fermipy/lib/python3.9/site-packages/fermipy/gtanalysis.py", line 237, in
SourceFind, ExtensionFit, lightcurve.LightCurve):
AttributeError: partially initialized module 'fermipy.lightcurve' has no attribute 'LightCurve' (most likely due to a circular import)

Can you help me?

Thank you

@ranieremenezes
Copy link

ranieremenezes commented Feb 15, 2024

The same problem happens to me, but only when I am using a Mac OS. This is not a problem for Linux. In easyfermi it is nearly one year since we blocked the multithread for Mac OS. I was about to open this same issue.

@omodei
Copy link
Member

omodei commented Apr 4, 2024

Thank Raniere, how do you block the multithread for Mac OS and not for Linux? Is it an environment variable that we can set, please provide an example that I can use.

@omodei omodei self-assigned this Apr 4, 2024
@astroSyvertHE
Copy link
Author

in my case I use this command for computing LC (in macOS):

lc = gta.lightcurve('4FGL J2158.8-3013', time_bins=tbins,
#multithread=True, nthread=8,
shape_ts_threshold = 9.0,
use_scaled_srcmap=True,
make_plots = True, outdir='one_month',
free_background=False,
use_local_ltcube=False,
free_radius=3.0)

In particular:

  1. I commented the multithread part
  2. I included this choice: use_local_ltcube=False, using False, otherwise the procedure doesn't create the cube and scrap in the folder for each time bins

Instead with the Ubuntu OS, I just uncommented the 1) point (the multithread part works), but even in this case I used use_local_ltcube=False for the same reason of macOS.

Cheers

@ranieremenezes
Copy link

Hi @omodei ,

In easyfermi we collect the OS name using:

import platform
OS_name = platform.system()

And then set multithreaded to False if the OS is a mac (i.e. "Darwin"):

if OS_name != "Darwin":
    self.gta.lightcurve([...], multithread=True, nthread=self.spinBox_N_cores_LC.value())
else:
    self.gta.lightcurve([...], multithread=False)

Hi @astroSyvertHE ,

I included this choice: use_local_ltcube=False, using False, otherwise the procedure doesn't create the cube and scrap in the folder for each time bins

  • Hmm, this one is new to me. Have you tried to compute a light curve with easyfermi (go for it with Linux)? We use use_local_ltcube=True and this was never an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants