-
What happened?When using scp.read_opus(name) when reading a number of OPUS files in Jupyter Notebook the cell finishes but the kernel is then stuck. What did you expect to happen?No response Minimal Complete Verifiable Exampledata_list = []
for i, file in enumerate(glob.glob(path)):
data_list.append(scp.read_opus(name)) Relevant log outputNo response Anything else we need to know?The notebook cell does not give any errors. It is just stuck EnvironmentINSTALLED VERSIONSSpectroChemPy's API - v.0.6.7 commit: None |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
Hi @3mrrrx I have tried to reproduce your issue: import spectrochempy as scp
from spectrochempy import preferences as prefs
import glob
DATADIR = prefs.datadir
OPUSDATA = DATADIR / "irdata" / "OPUS"
path = OPUSDATA
data_list = []
for i, file in enumerate(glob.glob(str(path)+"/*")):
if "background" in file:
continue # remove the background.0 file that can not been interpreted for now.
data_list.append(scp.read_opus(file))
data_list and got this result (without no stuck in Jupyter lab). [NDDataset: [float64] a.u. (shape: (y:1, x:2567)),
NDDataset: [float64] a.u. (shape: (y:1, x:2567)),
NDDataset: [float64] a.u. (shape: (y:1, x:2567)),
NDDataset: [float64] a.u. (shape: (y:1, x:2567))] Can you tell us more about the file your are reading. May be a problem with memory if they are very large? |
Beta Was this translation helpful? Give feedback.
-
Thank ypu fpr the quick reply and the code example. In tje example you are removing the background measurement. I didn't do this step in my code. I will try and see if this helps. The files have a normal size resulting from the default settings of the ir sensor. Nevertheless i will try and monitor the memory while load the files. I both cases i will be happy to report back on this. I could also try gave an example (sharing also the opus files) of how to produce the error. First thing for Monday Best regards and i am very happy to use scp |
Beta Was this translation helpful? Give feedback.
-
Hallo, so far i have tried to recreate and narrow down the issue, and could exclude that it is not memory related. weirdly the issue also does not happen at all, in which case this message is (repeatedly but different comm number) printed out in the console: No such comm: bd2e3fe89c4746b0962297872cb4fd19 what is this message and why is it printed? currently I am assuming that this issue might be related to a corrupted file or access issue (multiple programs accessing files). i will be spending some time working with the code and dataset this week, will try to further narrow down the issue, and create a dummy dataset that i could share |
Beta Was this translation helpful? Give feedback.
-
Apprently the juypter notebook gets stuck when reading the file one-by-one, reading the same files in bulk e.g. as folder does not result in this isssue! |
Beta Was this translation helpful? Give feedback.
-
Making a rapid google search, I found that may be it is related to Jupyter, not Spectrochempy: Anyway it is difficult to help you as I can't reproduce this problem with my files. |
Beta Was this translation helpful? Give feedback.
-
thank you for your support so far. i am also coming to the conclusion that this is related more to Jupyter Notebooks. still based on some discussions i was having with some colleges there are two notes worth mentioning:
|
Beta Was this translation helpful? Give feedback.
-
I don't really know about OPUS, as I've never used it. @atravert since you wrote this code, can you comment on it? |
Beta Was this translation helpful? Give feedback.
-
Hello @3mrrrx , Can you post some of these OPUS files ? I will have a look at them and if possible adapt the reader to avoid these problems in jupyter. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello, and thank you for the replay! I would be happy to send you these for testing. currently, I am not sure I can publish these publicly yet! |
Beta Was this translation helpful? Give feedback.
-
Hello @3mrrrx , I have looked at your issue and could reproduce it with jupyter notebook version 6.5.3, and it does not appear for notebook>= 6.5.5. The bug is actually not related to spectrochempy but to jupyter, and described here: jupyter/notebook#6721 Can you check, on your side, which notebook version you used ?
You can fix it by upgrading jupyter notebook to v.6.5.5
or
Or, instead of jupyter notebook, you can use Jupyter Lab, which we recommend for spectrochempy (https://www.spectrochempy.fr/latest/userguide/introduction/interface.html#Create-a-new-Jupyter-notebook). I hope this helps. Of course let me know if this does not solve your problem ! My apologies for the delay.... Best regards, Arnaud |
Beta Was this translation helpful? Give feedback.
Hello @3mrrrx ,
I have looked at your issue and could reproduce it with jupyter notebook version 6.5.3, and it does not appear for notebook>= 6.5.5. The bug is actually not related to spectrochempy but to jupyter, and described here: jupyter/notebook#6721
Can you check, on your side, which notebook version you used ?
$ conda list notebook
You can fix it by upgrading jupyter notebook to v.6.5.5
$ mamba install notebook=6.5.5
or
$ conda install notebook=6.5.5
Or, instead of jupyter notebook, you can use Jupyter Lab, which we recommend for spectrochempy (https://www.spectrochempy.fr/latest/userguide/introduction/interface.html#Create-a-new-Jupyter-notebook).
I hope this helps. Of course let …