Skip to content

replace (local/global_)arrays functions by (locals/globals_)to_session functions? #609

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

Open
alixdamman opened this issue Mar 26, 2018 · 4 comments

Comments

@alixdamman
Copy link
Collaborator

@gdementen Once #578 implemented, Sessions should include Axis and Group objects by default, so... Do you agree with this issue?

@alixdamman alixdamman added this to the 0.29 milestone Mar 26, 2018
@alixdamman alixdamman self-assigned this Mar 26, 2018
@gdementen
Copy link
Contributor

gdementen commented Mar 26, 2018

You kind of open Pandora's box if you do that, but that is bound to happen one day or another, so let's start:

  1. What is the use case for having this? I don't mean this in a way that this should not be done, just that finding usecases will help us answer the questions below.
  2. I think having arrays, axes and groups without scalars is bound to create frustration for our users.
  3. I don't really like the name (but maybe I only need more time to get used to it). If the criterion to take or not take a variable is "data" vs "non-data", we could name them:
    local_data(), global_data() and data()/available_data()/all_data()?
  4. assuming we do scalars, what do we do with simple Python structures: tuple, list, dict and set of data? and nested structures of those?
  5. how do we handle functions and other more exotic/unsupported types? Just ignore them or warn if present (for functions that would be in most cases, so that would be useless I think, but no warning could lead to dataloss) or try to save them via pickle (or some other lib which can serialize anything)? I think that ideally we should have "known unsupported types" which do not warn, but than warn for other types. The result would be that if a user tries to use data in an unsupported type, he gets a warning that his data has not been saved.

@alixdamman alixdamman removed this from the 0.29 milestone Mar 26, 2018
@alixdamman
Copy link
Collaborator Author

alixdamman commented Mar 26, 2018

You know how LArray is used in some in-house models. If we modify Session.save and Session.load so as to include non-LArray objects, users will wonder why it is not same when creating session from global objects even if they don't need them.

Well, the best is maybe to not fix this issue as long as a user doesn't ask.

@alixdamman alixdamman added this to the 0.30 milestone Jun 27, 2018
@alixdamman
Copy link
Collaborator Author

@gdementen I think this issue is no longer a question. We now have Session objects that contain axes, groups and arrays. Still having local/global_arrays functions is quite inconsistent, don't you think?

@gdementen
Copy link
Contributor

Indeed, but there are open questions anyway: how to name the new functions and the other questions I raise above. Concerning the name, I still don't really like locals_to_session and globals_to_session.

@alixdamman alixdamman modified the milestones: 0.30, 0.31, 0.32 Jan 31, 2019
@alixdamman alixdamman removed this from the 0.32 milestone Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants