Navigation Menu

Skip to content
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

The example given in data_saver.py doesn't compile. #46

Closed
basnijholt opened this issue Dec 19, 2018 · 1 comment
Closed

The example given in data_saver.py doesn't compile. #46

basnijholt opened this issue Dec 19, 2018 · 1 comment

Comments

@basnijholt
Copy link
Member

(original issue on GitLab)

opened by Piotr (@Benedysiuk) at 2018-09-04T18:55:17.775Z

Data_saver.py is broken.
There is a missing import and even with it one gets Attribute Error when trying to run it.
Full trace back:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-24-9aee42ca60f3> in <module>()
      1 _learner = adaptive.Learner1D(simulate, bounds=(-0.001, 0.001))
----> 2 learner = adaptive.DataSaver(_learner, arg_picker=operator.itemgetter('particles'))

/opt/conda/lib/python3.6/site-packages/adaptive/learner/data_saver.py in __init__(self, learner, arg_picker)
     34 
     35         # Methods that the BaseLearner implements
---> 36         self.add_data = self.learner.add_data
     37         self.__getstate__ = self.learner.__getstate__
     38         self.__setstate__ = self.learner.__setstate__

AttributeError: 'Learner1D' object has no attribute 'add_data'
@basnijholt
Copy link
Member Author

originally posted by Bas Nijholt (@basnijholt) at 2018-09-05T08:21:35.397Z on GitLab

From your traceback I can see that you are using the old version of adaptive, please update.

Also, the import is not needed inside the file because operator is never used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant