databroker icon indicating copy to clipboard operation
databroker copied to clipboard

scikit-image needed as requirement?

Open prjemian opened this issue 5 years ago • 4 comments
trafficstars

Getting this error when creating a databroker instance:

(bluesky_2020_9) prjemian@poof ~/.../use_bluesky/python_installation $ ipython
Python 3.8.2 (default, Mar 26 2020, 15:53:00) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import databroker                                                                                                                                                                             
/home/prjemian/Apps/anaconda/envs/bluesky_2020_9/lib/python3.8/site-packages/pims/image_reader.py:26: RuntimeWarning: PIMS image_reader.py could not find scikit-image. Falling back to matplotlib's imread(), which uses floats instead of integers. This may break your scripts. 
(To ignore this warning, include the line "warnings.simplefilter("ignore", RuntimeWarning)" in your script.)
  warnings.warn(RuntimeWarning(ski_preferred))

This also shows up in some documentation online: (see https://blueskyproject.io/tutorials/Hello%20Bluesky.html#Configuration): Clipboard01

prjemian avatar Aug 12 '20 22:08 prjemian

I'm not happy with turning off warnings. That seems like it silences the reporter rather than fix the problem.

With conda install scikit-image -c conda-forge, this error goes away.

So, is scikit-image a requirement for databroker now?

prjemian avatar Aug 12 '20 22:08 prjemian

Feels it is a dependency of pims, not directly of databroker. In a fresh conda environment, does it install scikit-image along with pims? Did you use pip to install databroker? What happens when you install from the nsls2forge conda channel?

mrakitin avatar Aug 13 '20 02:08 mrakitin

Agree that it looks like an optional dependency of pims, advising the action it is taking since scikit-image was not found. This message comes up with an install today of databroker and other components using conda. I'm developing a new environment.yml for the next APS operations cycle. The message above shows how to trigger the warning which happens when scikit-image is left out of the YAML file. Try it with command: conda env create -f environment_2020_9.yml -n bluesky_2020_9

prjemian avatar Aug 13 '20 04:08 prjemian

Yeah. I wish pims wasn't so shout-y about this. I wasn't watching closely when that got merged into pims. Maybe we can get pims to defer that warning until a relevant class is actually used.

Once we really trust that databroker.v1 is solid and strip databroker.v0 out of the codebase, we can drop the pims dependency (and many others) in databroker, and this issue will go away.

danielballan avatar Aug 14 '20 18:08 danielballan