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

BXASolver run cannot be interrupted in jupyter lab #45

Open
ivvv opened this issue May 11, 2023 · 3 comments
Open

BXASolver run cannot be interrupted in jupyter lab #45

ivvv opened this issue May 11, 2023 · 3 comments

Comments

@ivvv
Copy link

ivvv commented May 11, 2023

  • BXA version: 4.1.1
  • UltraNest version: 3.5.7
  • Python version: 3.11.3
  • Xspec or Sherpa and version: xspec 12.13.0c
  • Operating System: Mac OS Ventura 13.2.1 (also on Ubuntu 22)

Description

Running solver.run() cannot be interrupted in jupyter lab.

What I Did

Running this in a jupyter lab cell:

solver = bxa.BXASolver(transformations=transformations, outputfiles_basename=outputfiles_basename)
results = solver.run(resume=True)

Trying to interrupt the process/kernel does not work, the iterations go on and on. The only remedy is to restart the kernel which leads to losing the session.

I am not sure if this is BXA or ultranest issue, there should be a possibility to make the iterations interruptible somehow.

Thanks,
Ivan

@JohannesBuchner
Copy link
Owner

JohannesBuchner commented May 11, 2023

It is probably an xspec issue actually, xspec may catch KeyboardInterrupt signals and python/jupyter/... does not know about it. You'd have to look at how xspec registers/overwrites signals.

@JohannesBuchner
Copy link
Owner

I think if you keep hammering the process with Ctrl-Cs (cell selected, keep it pressed), eventually you hit it where it is within the python/ultranest code execution, not within the xspec C execution, and this can stop the iterating.

@ivvv
Copy link
Author

ivvv commented May 12, 2023

I guess this issue can be closed. Before raising the issue I looked for 'interrupt' in all issues and couldn't find anything. So, maybe some information in the docs on this particular behaviour would be useful for others.

I have not checked if using BXA with sherpa is ok in this respect, i.e. the process can be stopped in a "normal" way.

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