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

Add function_data classes from InfrastructureSystems #33

Merged
merged 17 commits into from
Jun 28, 2024

Conversation

jerrypotts
Copy link
Collaborator

@jerrypotts jerrypotts commented Jun 20, 2024

Added new file (function_data.py) to include the function_data structs from InfrastructureSystems as python classes, which are necessary for parsing data for cost function inputs into Sienna. I included classes for linear and quadratic functions, as well as piecewise linear and piecewise step functions.

Note, we kept PiecewiseLinearData.points as a list of NamedTuples (rather than change it to two separate lists of x, y coordinates) to ensure it is consistent with the structs built on top of function_data in InfrastructureSystems and elsewhere.

@pesap pesap self-requested a review June 20, 2024 16:32
@pesap pesap added enhancement New feature or request good first issue Good for newcomers labels Jun 20, 2024
src/infrasys/function_data.py Outdated Show resolved Hide resolved
src/infrasys/function_data.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@pesap pesap left a comment

Choose a reason for hiding this comment

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

LGTM, can you address the changes and update the docstring to match the following style: https://numpydoc.readthedocs.io/en/latest/example.html.

src/infrasys/function_data.py Outdated Show resolved Hide resolved
src/infrasys/function_data.py Outdated Show resolved Hide resolved
src/infrasys/function_data.py Outdated Show resolved Hide resolved
src/infrasys/function_data.py Outdated Show resolved Hide resolved
tests/test_function_data.py Outdated Show resolved Hide resolved
@pesap
Copy link
Collaborator

pesap commented Jun 28, 2024

@jerrypotts , we are working on a patch for the runner so that this can be tested. Let's leave the update of the fields to a following PR.

@pesap pesap merged commit d17754e into NREL:main Jun 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants