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

Bnb/dev #141

Merged
merged 4 commits into from
Jan 11, 2023
Merged

Bnb/dev #141

merged 4 commits into from
Jan 11, 2023

Conversation

bnb32
Copy link
Collaborator

@bnb32 bnb32 commented Jan 11, 2023

some refactoring - ForwardPassStrategy/Regridder -> DistributedProcess. Changed inheritance order in wind models to remove _wind methods.

@staticmethod
def set_model_params_wind(**kwargs):
# pylint: disable=E0211
def set_model_params(self, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

shouldnt this be a static method still?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep lol

@@ -12,7 +12,7 @@
logger = logging.getLogger(__name__)


class WindGan(Sup3rGan, AbstractWindInterface):
class WindGan(AbstractWindInterface, Sup3rGan):
Copy link
Member

Choose a reason for hiding this comment

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

oh nice! just reordering solves the inheritance priority? Great!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah! Python's solution to the diamond problem!

@@ -499,6 +496,10 @@ def __init__(self, source_files, out_pattern, target_meta, heights,
cache_pattern=cache_pattern,
n_chunks=n_chunks,
max_workers=self.query_workers)
DistributedProcess.__init__(self, max_nodes=max_nodes,
Copy link
Member

Choose a reason for hiding this comment

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

Oh wow i didnt know you could just call the inherited init directly and pass in self! that makes so much sense. Nice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Didn't know this worked either just figured it should lol

@@ -26,6 +26,130 @@
logger = logging.getLogger(__name__)


class DistributedProcess:
Copy link
Member

Choose a reason for hiding this comment

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

Suggest this goes into utilities/execution.py or similar.... the utilities.py file is getting totally ridiculous.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I figured you'd have a suggestion for where to put this. I didn't like it here either.

@bnb32 bnb32 assigned malihass and unassigned malihass Jan 11, 2023
@bnb32 bnb32 requested a review from malihass January 11, 2023 17:32
@bnb32 bnb32 removed the request for review from malihass January 11, 2023 19:16
@bnb32 bnb32 merged commit 0e83ada into main Jan 11, 2023
@bnb32 bnb32 deleted the bnb/dev branch January 11, 2023 19:16
github-actions bot pushed a commit that referenced this pull request Jan 11, 2023
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.

None yet

3 participants