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
Let users never see Entry objects #490
Conversation
(I'm sure a load of tests would need updating, but would like comments sooner rather than later) |
def describe(self): | ||
return self.entry.describe() | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an application layer thing that should not be baked into the core objects. If this is something that was there and needs to stay for back compatibility can we deprecate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, you could construct a GUI for an entry previously (which allowed you to select the user parameters and then plot with point&click); so if the user is no longer exposed to the entry object, this is the only way to do it. Of course, we could question the usefulness of that particular GUI view, but otherwise the source no longer has any connection to the GUIs at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes a lot more sense to me to pass the DateSrouce
to the gui (make_the_clicky_gui(ds)
) rather than have it be a method so that it is possible to support exposing several gui generation tactics to the user (ex "all the details" vs "executive summary").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too would like to revisit this, but I think should not lump that into this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GUI code can probably do with a refactor following improvements in https://github.com/intake/filesystem_spec/blob/master/fsspec/gui.py#L14
Sorry for crashing into your code base with possibly more opinions than understanding. |
It is appreciated! |
Thanks for leading the way on this, @martindurant! I am still under a rock but should emerge next week to look at this. |
Good to go, reviews appreciated! (docs still need updating in some places; may have knock-on errors in dependent packages which need sorting before blanket releases) |
I'd like to beg another week or so to look at this. Racing to prep for a big tutorial a week from tomorrow (unveiling databroker-refactored-on-top-of-intake among other things). |
@danielballan , I can wait :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am convinced that this approach is better than the one I had in mind. Retaining Entry
as an internal entity will be useful for a least two reasons I can think of:
- making new instances with different parameters cleanly
- giving us a bundle of parameters that we can pickle, whereas DataSource instances themselves may carry un-pickleable resources like file handles or sockets
Also, this is clearly as an easier refactor than attempting to excise Entry from the codebase. :-)
I have a couple comments for your consideration. I would also like to test databroker against this branch before it is merged. Will post results today or tomorrow.
def describe(self): | ||
return self.entry.describe() | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too would like to revisit this, but I think should not lump that into this PR.
This requires some small changes to databroker but I now have a branch bluesky/databroker#569 that passes against this intake PR branch, intake master, and intake 0.5.5. I also took it for a spin interactively, and it behaves as expected. Remaining concerns:
Thanks again @martindurant for taking this on. |
Last call for comments |
(updates to docs will follow merger and release) |
I'm seeing a regression from the last commit but I don't understand it yet. Please hold merging while I investigate. |
Looks like it was just a confusion on my end, I must have had different branches installed than I thought. Full steam ahead! |
Rebased to resolve conflicts and force-pushed |
Did the same, but you were faster!
|
Welp, looks like I introduced a syntax error in rebase.... |
fixed... |
Test failure is on one build, GUI related. |
You took the button press away from me! :) |
This is "unification light" - still have Entry objects, but the user doesn't see them. The catalog just gives you the default source directly, but you can override them with call or clone (maybe should be get??) to get a new version of the source. Note that
.describe()
will give you the original catalog definition (with user parameters), not your overridden version, but repr of the source now also gives you that YAML view with the current set of arguments.cc @danielballan @tacaswell