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

refactor: calculate timesteps separately #284

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

jsolaas
Copy link
Contributor

@jsolaas jsolaas commented Nov 15, 2023

Process one timestep at a time in v2

@jsolaas jsolaas requested a review from a team as a code owner November 15, 2023 18:25
@jsolaas jsolaas force-pushed the refactor/point-in-time-v2 branch 2 times, most recently from 2567733 to dcfcb34 Compare November 15, 2023 19:50

ComponentID = str


@dataclass
class PriorityOptimizerResult(Generic[TResult]):
priorities_used: TimeSeriesString
priority_used: PriorityID
Copy link
Collaborator

Choose a reason for hiding this comment

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

<3


def __lt__(self, other: Pressure) -> bool:
if self.unit != other.unit:
raise ValueError("Unit mismatch")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use domain specific exceptions, but they can perhaps extend ValueError in order to easily catch higher up?

self._operational_settings: Optional[CompressorOperationalSettings] = None

def get_max_rate(self, inlet_stream: StreamConditions, target_pressure: TimeSeriesFloat) -> List[float]:
def get_max_rate(self, inlet_stream: StreamConditions, target_pressure: Pressure) -> float:
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "For each timestep" in docstring.

Base automatically changed from refactor/collect-priority-results-in-priority-optimizer to main November 16, 2023 13:17
Process one timestep at a time in v2
@jsolaas jsolaas merged commit bd9d684 into main Nov 16, 2023
6 checks passed
@jsolaas jsolaas deleted the refactor/point-in-time-v2 branch November 16, 2023 13:28
equinor-schen pushed a commit that referenced this pull request Nov 22, 2023
Process one timestep at a time in v2
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.

3 participants