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

Add property decorators in World #209

Closed
ftomassetti opened this issue Nov 23, 2015 · 4 comments · Fixed by #236
Closed

Add property decorators in World #209

ftomassetti opened this issue Nov 23, 2015 · 4 comments · Fixed by #236
Assignees

Comments

@ftomassetti
Copy link
Member

For example:

@property
def elevation:
    return self.layers['elevation'].data
@tcld tcld mentioned this issue Nov 23, 2015
@tcld
Copy link
Contributor

tcld commented Nov 23, 2015

It might not hurt if you added this to #207, if you could spare the time. By "add" I mean "create all necessary functions and then replace every use of any layer throughout the code with a call to the corresponding property".

Also, do you need to explicitly create a setter, too?

@property
def elevation(self):
    return self.layers['elevation'].data

@elevation.setter
def elevation(self, value):
    self.layers['elevation'].data = value

@ftomassetti
Copy link
Member Author

Me and Bret discussed it and we would prefer to go by steps: so we first merge #207 and then introduce property decorators. I am not sure about the setters perhaps it could make sense given we had all those set_ocean, set_temperature methods to replace

@psi29a
Copy link
Member

psi29a commented Nov 23, 2015

Thanks for this @tcld it is good plan. :)

@Himura2la
Copy link
Contributor

Himura2la commented Oct 8, 2016

I'm going to convert to properties all functions that starts with set_ in Setters section.

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

Successfully merging a pull request may close this issue.

4 participants