-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use meaningful domain type locations/imports #95
Comments
Avoiding # File names
params[Filename[SampleRun]] = '60339-2022-02-28_2215.nxs'
params[Filename[BackgroundRun]] = '60393-2022-02-28_2215.nxs'
params[Filename[TransmissionRun[SampleRun]]] = '60394-2022-02-28_2215.nxs'
params[Filename[TransmissionRun[BackgroundRun]]] = '60392-2022-02-28_2215.nxs'
params[Filename[EmptyBeamRun]] = '60392-2022-02-28_2215.nxs' would become more cumbersome? from esssans.io import types as iotypes
from esssans.normalization import TransmissionRun
# File names
params[iotypes.Filename[SampleRun]] = '60339-2022-02-28_2215.nxs'
params[iotypes.Filename[BackgroundRun]] = '60393-2022-02-28_2215.nxs'
params[iotypes.Filename[TransmissionRun[SampleRun]]] = '60394-2022-02-28_2215.nxs' In addition, I think if we scatter all the types in different places, inspecting intermediate results may become more difficult. from esssans.conversions import ElasticCoordTransformGraph
res = pipeline.compute(ElasticCoordTransformGraph) Wouldn't we be making it even worse if one has to remember where to find the types in all the different submodules? |
Why would you use |
To reiterate form previous discussions:
|
I've tried a couple of things, but I can't seem to get around having to have a long from esssans import (
Filename,
SampleRun,
BackgroundRun,
TransmissionRun,
EmptyBeamRun,
WavelengthBins,
WavelengthBands,
CorrectForGravity,
UncertaintyBroadcastMode,
ReturnEvents,
QBins,
PixelMaskFilename,
BackgroundSubtractedIofQ,
) at the start of the notebook. Was that the intention? Another thing: without the from esssans.types import MaskedData
masked = pipeline.compute(MaskedData[SampleRun]) which degrades usability I think. I know we don't like the |
It is your choice to |
Sure, but that becomes very difficult if the types are scattered over many files/submodules internally. So unless we find a better alternative, I might suggest to have, for every submodule, a single place where we put all the types (and we don't have to call it types if you think the name doesn't make sense to scientists). This would allow you to do: from esssans.types import *
from esssans.loki.types import * and you would have all you need if you are working with Loki. We would then not have any types in the other files in the I agree that we should leave it out of the docs 👍 , but I think you should still be able to use it because it is very convenient? |
Not sure what you are saying, we cannot possible prevent people from doing |
I really don't see why we need from esssans import *
from esssans.loki import * |
In theory, yes, Inspecting intermediate results will be very common in hot commissioning. |
Regarding not being able to easily find the full path to a type when looking at a task graph: I also tried adding 'fake' url to the types nodes, where you could right-click on the svg and do "copy link address", but instead of a http url it would just be the full type path that you could then paste back into your notebook and use |
The conclusion was that we will wait with this until we have more experience with more workflows. Moving to blocked. |
Currently many "types" are in
esssans.types
, and we usefrom esssans.types import *
. Apart form wanting to avoid theimport *
,types
is also meaningless to scientists. Therefore:__init__.py
), avoidimport *
.The text was updated successfully, but these errors were encountered: