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

Attributes of Adel object not updated after loading a MTG #5

Open
rbarillot opened this issue Jul 17, 2017 · 1 comment
Open

Attributes of Adel object not updated after loading a MTG #5

rbarillot opened this issue Jul 17, 2017 · 1 comment

Comments

@rbarillot
Copy link

Hi,

The attributes of an Adel object are not updated after loading a pickled MTG.

For instance, the script below,

from alinea.adel.astk_interface import AdelWheat

# Save MTG
adel_wheat_1 = AdelWheat(nplants=10)
g1 = adel_wheat_1.setup_canopy()
adel_wheat_1.save(g1)
print 'saved domain: ', adel_wheat_1.domain
print 'saved nplants: ', adel_wheat_1.nplants

# Loading MTG previously pickled 
adel_wheat_2 = AdelWheat()
g2 = adel_wheat_2.load(dir=r'~\adel_saved')
print 'loaded domain: ', adel_wheat_2.domain
print 'loaded nplants: ', adel_wheat_2.nplants

gives:

>>> 
'saved domain: ' ((-13.333333333333336, -7.5), (13.333333333333336, 7.5))
'saved nplants: ' 10
'loaded domain: ' ((-1.3333333333333335, -7.5), (1.3333333333333335, 7.5))
'loaded nplants: ' 1
@rbarillot
Copy link
Author

Hi @christian34 ,

did you fix this issue? I still have the problem on my machine

Thx

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