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

#137-allow-to-use-different-names-for-the-spatial-exposure-data #141

Conversation

frederique-hub
Copy link
Collaborator

self.set_exposure_geoms(assets)
self.set_geom_names("buildings")

def set_geom_names(self, name: str) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for my understanding: the function set_geom_names is defined here but it is already used above.
is self.set_geom_names somewhere else defined beforehand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question - I did not even think about it because it just worked. It is indeed used in line 244 and only defined in line 246. I think that is possible because they are functions within a class and they are all loaded at initialization of the class. This page explains a bit more: https://stackoverflow.com/questions/29055698/does-the-order-of-variables-and-functions-matter-in-class-python . If you want to read about classes in Python, the documentation is here: https://docs.python.org/3/tutorial/classes.html, although I don't think it's the most clear documentation

@frederique-hub frederique-hub merged commit 686d08a into fiat_integrator Sep 28, 2023
@frederique-hub frederique-hub deleted the #137-allow-to-use-different-names-for-the-spatial-exposure-data branch September 28, 2023 12:41
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

Successfully merging this pull request may close these issues.

2 participants