-
Notifications
You must be signed in to change notification settings - Fork 6
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
FList can't be pickled #88
Comments
The reason I created these dynamical lists was to enable the possibility of writing LSST.filters.u.effective_wavelength and having autocompletion in ipython or any IDE, instead of writing LSST.get_filter('u').effective_wavelength where you actually need to check first which filters are available. |
It cannot be solved through the trick of writing The only option seems to abandon that functionality for a dictionary, but sadly that was one of the coolest features I had created for galcheat 😢 |
I spoke about a way to potentially solve this at the meeting today (by replacing multiprocessing by pathos.multiprocessing) ; however I tried it and it does not seem to work :( |
Thanks @aboucaud and @thuiop for looking into this. And thanks @aboucaud for explaining your reasoning on doing this. It is indeed unfortunate that we need to abandon the FList due to multiprocessing solely and that other workarounds don't seem to work. I'll think more about this today and let you know if I can come up with a workaround in BTK. |
Closed by #92 |
As I'm trying to replace the survey functionality of BTK with galcheat, I realized that I can't pickle the galcheat.survey.Survey class due to it containing a dynamically generated dataclass
FList
. See here and here.Would it be possible to replace it with just a dictionary? Or why is the FList necessary? Thanks you! The reason I need to pickle it is to run multiprocessing which internally pickles objects.
One workaround that was suggested was to do
FList.__module__ = __name__
(where it is created). But it seems a bit hacky and perhaps easier to replace with a dictionary if possible@aboucaud
The text was updated successfully, but these errors were encountered: