rs-station / laue-dials

A package for analyzing Laue x-ray crystallography data using the DIALS framework.
https://rs-station.github.io/laue-dials/
MIT License
4 stars 3 forks source link

IOCTL error in jupyter notebook #43

Closed DHekstra closed 9 months ago

DHekstra commented 9 months ago

I just switched to using a local install of my cloned repo (fresh from git pull and pip install -e .). Running the PYP example, I am encountering cells that run in the terminal but not from a notebook, with the following error:

Traceback (most recent call last):
  File "/n/hekstra_lab/people/dhekstra/conda_envs/laue-dials/bin/laue.find_spots", line 5, in <module>
    from laue_dials.command_line.find_spots import run
  File "/n/home12/dhekstra/ipython_notebooks/laue-dials/src/laue_dials/command_line/find_spots.py", line 17, in <module>
    laue_version()
  File "/n/home12/dhekstra/ipython_notebooks/laue-dials/src/laue_dials/utils/version.py", line 7, in laue_version
    width = os.get_terminal_size().columns
            ^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 25] Inappropriate ioctl for device

Use /n/hekstra_lab/projects/laue-dials-tests/hemoglobin_TR/playground/tutorial-hemoglobin-Copy1.ipynb to replicate.

PrinceWalnut commented 9 months ago

This came from the version printing trying to get the width of the terminal (which doesn't exist in a notebook). Added some logic flow for non-terminal outputs in this commit. This should fix the issue, so closing it, but please reopen if the behavior continues.