Skip to content

Suggested changes to PR 912#950

Merged
mloning merged 1 commit intoforecast-base-refactorfrom
forecast-base-refactor-suggestions
Jun 12, 2021
Merged

Suggested changes to PR 912#950
mloning merged 1 commit intoforecast-base-refactorfrom
forecast-base-refactor-suggestions

Conversation

@mloning
Copy link
Contributor

@mloning mloning commented Jun 12, 2021

Reference Issues/PRs

#912

@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

Hi @fkiraly, here are my suggested changes, let me know what you think!

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 12, 2021

I think this will mess up the tags, since assignments of the _tags class variable will override each other and not give you the set union of dictionary elements.

I would really really like to go with the current, working workaround, and we make changes like this later on?

In particular, the mixins need to be completely removed in a second step, I was just going for an intermediate state where we bundle the logic in the base class.

@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

@fkiraly I prefer this solution, this way, when we remove the mixins, we only have to copy the tags to the concrete forecasters, plus we don't change the constructor. Note that tags are not overridden, that's handled in _all_tags.

@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

@fkiraly this is part of your current work around, but introduces less unnecessary intermediate code and instead uses the tags as we would use them later, no?

@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

So I suggest to merge this and then go ahead with the refactoring of the concrete forecasters.

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 12, 2021

hm, but then, you would have to change the "tags" inspection in _set_fh to _all_tags, no?

@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

that's what's happening inside _has_tag

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 12, 2021

not sure I understand what you mean, but I mean that current line 524, optfh = self._tags["fh_in_fit"] == "optional" would have to use _all_tags instead, no?

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 12, 2021

oh, I see, that's already happening inside _has_tag, got it.

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

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

fine with this (see above)

@fkiraly fkiraly changed the title Suggested changes Suggested changes to PR 912 Jun 12, 2021
@mloning
Copy link
Contributor Author

mloning commented Jun 12, 2021

I changed that line in this PR, take a look at the suggested changes in this PR. They would be merged into your branch in #912. Does that help?

@fkiraly
Copy link
Collaborator

fkiraly commented Jun 12, 2021

yes, I just overlooked the change in line 524, all fine

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