refactor!: remove ADJUSTMENT from FACILITY_INPUTS#1339
Merged
Conversation
3c51ab7 to
e8b54ed
Compare
Contributor
Author
jsolaas
approved these changes
Jan 23, 2026
Comment on lines
+56
to
+68
| def validate_adjustment(self): | ||
| if current_version() >= Version( | ||
| 14 | ||
| ): # Just break all yaml to make sure we remember to remove ADJUSTMENT altogether | ||
| raise ValueError( | ||
| "ADJUSTMENT is no longer valid in libeCalc v14.0 and has been removed. See the migration guide on how to migrate." | ||
| ) | ||
|
|
||
| if self.adjustment is not None: # < 14 we give error if ADJUSTMENT is used | ||
| raise ValueError( | ||
| "ADJUSTMENT was removed in libeCalc v13.0 and is no longer supported. See the migration guide on how to migrate." | ||
| ) | ||
| return self |
Contributor
There was a problem hiding this comment.
Change to before validator and remove adjustment definition above? That way we will get validation errors in json-schema.
e8b54ed to
635d400
Compare
jsolaas
approved these changes
Jan 26, 2026
Comment on lines
+51
to
+56
| adjustment = values.get("ADJUSTMENT") | ||
|
|
||
| if adjustment is not None: | ||
| raise ValueError( | ||
| "ADJUSTMENT along with FACTOR and CONSTANT was removed in libeCalc v13.0 and is no longer supported. See the migration guide on how to migrate." | ||
| ) |
Contributor
There was a problem hiding this comment.
Suggested change
| adjustment = values.get("ADJUSTMENT") | |
| if adjustment is not None: | |
| raise ValueError( | |
| "ADJUSTMENT along with FACTOR and CONSTANT was removed in libeCalc v13.0 and is no longer supported. See the migration guide on how to migrate." | |
| ) | |
| if isinstance(values, dict) and "ADJUSTMENT" in values: | |
| raise ValueError( | |
| "ADJUSTMENT along with FACTOR and CONSTANT was removed in libeCalc v13.0 and is no longer supported. See the migration guide on how to migrate." | |
| ) |
If values is not dict it's handled by pydantic
635d400 to
203130b
Compare
frodehk
approved these changes
Jan 26, 2026
ADJUSTMENT in FACILITY_INPUTS has been of little usage, and it is easy to manipulate data oneself, instead of ecalc providing this functionality. Refs: equinor/ecalc-internal#1425
203130b to
8471c67
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

ADJUSTMENT in FACILITY_INPUTS has been of little usage, and it is easy to manipulate data oneself, instead of ecalc providing this functionality.
Refs: equinor/ecalc-internal#1425
Type of Work
See here (internal): https://github.com/equinor/ecalc-internal/discussions/1044
Have you remembered and considered?
docs/drafts/next.draft.md)docs/docs/migration_guides/)BREAKING:in footer or!in headerWhat is this PR all about?
What else did you consider?
Between the lines?