Repository navigation
Finalise/simplify GB model names; make the trend adjuster a boolean #379
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
349c47e
feat: simplify GB model names and make the trend adjuster a boolean
braddf b6e3247
fix: tighten model validation from PR review
braddf c249dfb
refactor: inline ForecastModel.accepts into get_model_by_api_name
braddf 241ccd8
fix: advertise the renamed NL uncurtailed slug, alias the old one
braddf 15a3ed1
style: order the NL uncurtailed label to match its slug
braddf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come you didnt make these lists of strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll admit my view of Python dataclasses rules and regs is still mixed, but I spent a bit of time thinking about this config, and there are a couple of things here trying to keep these top Classes tight as poss:
A plain
listdefault won't actualy import – dataclasses reject it:ValueError: mutable default <class 'list'> for field aliases is not allowed: use default_factory. So every alias field would need wrapping infield(default_factory=list), which feels like a bit of shoehorning in comparison to a tuple, which does work.Secondly,
frozen=Trueonly stops you replacing a field, not changing what's inside it.fm.aliases = (...)is blocked, butfm.aliases.append(...)would work fine on a list.COUNTRIESis built once when the module loads and shared by every request, so a strayappendanywhere would change model routing for everything that worker handles afterwards... and only that worker, which would be horrible to debug. A tuple has noappend, so it can't happen by design, so I'd say this is the pattern we want to adoptThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that sounds sensible