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

Overhaul HDF serialization/deserialization for FunctionData #330

Closed
GabrielKS opened this issue Feb 21, 2024 · 3 comments
Closed

Overhaul HDF serialization/deserialization for FunctionData #330

GabrielKS opened this issue Feb 21, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@GabrielKS
Copy link
Contributor

I am about to submit a PR to add FunctionData, a better way to represent cost functions, to InfrastructureSystems. I will have adapted the existing HDF serialization/deserialization code for certain types of FunctionData, but FunctionData can represent more cost functions than the existing data structures, so more serialization/deserialization routines will need to be implemented in the future — for instance, something to handle polynomials of arbitrary degree, which might look like

function transform_array_for_hdf(data::Vector{PolynomialFunctionData})
    coeffs = data .|> get_coefficients .|> collect
    return cat((hcat(([a, b] for (a, b) in coeff)...) for coeff in coeffs)...; dims=3)
end

This would also be a good opportunity to clean up the code duplication that exists between the various methods of transform_array_for_hdf, etc.

@GabrielKS GabrielKS added the enhancement New feature or request label Feb 21, 2024
@GabrielKS GabrielKS self-assigned this Feb 21, 2024
@GabrielKS
Copy link
Contributor Author

The aforementioned PR is #331.

@jd-lara
Copy link
Member

jd-lara commented Mar 5, 2024

I don't think we intend to support arbitrary function data for MarketBid Cost since the markets only accept PWL data in very specific formats. There is no need no serialize deserialize arbitrary polynomials.

The engineering cost of this solution might be larger than the benefits.

@GabrielKS
Copy link
Contributor Author

I did some rewriting of HDF (de)serialization and I think I'm happy with where it is now, currently no need for something this drastic. Closing for now.

@GabrielKS GabrielKS closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants