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

result["data"] #184

Open
rb004f opened this issue May 1, 2020 · 6 comments
Open

result["data"] #184

rb004f opened this issue May 1, 2020 · 6 comments

Comments

@rb004f
Copy link
Collaborator

rb004f commented May 1, 2020

result["data"] should report the count of the new components, such as storage, transfers, etc. Update the results_data.md file when this is done

@ccoffrin
Copy link
Member

ccoffrin commented May 1, 2020

I dropped this feature in IM v0.5 because it was not obvious how we could easily generalize across packages and I didn't really see a need for it anymore. Do you have a use case in mind?

@rb004f
Copy link
Collaborator Author

rb004f commented May 1, 2020

The statistics are still being reported in GasModels (as of the v0.7 branch). If we are going to continue to report it, we should keep it up to date. It was/is a nice feature to sometimes look at when inspecting a solution, but not a core feature. In terms of generalization, what about generating a foo_count for any entry at the top level of the data dictionary for which itself is a dictionary?

@ccoffrin
Copy link
Member

ccoffrin commented May 1, 2020

Got ya. The generalization you propose could work. Another option is to have a function that each package can overload as they prefer.

Part of my motivation was that a typical workflow would look like,

data = parse(...)
result = run_foo(data, ...)
print_stats(data, result["solution"])

If you would like to summarize the solution, you would usually have the data right next to it. So you can design some arbitrary post-processing function to generate metrics that are better than the simple one that used to be in result["data"].

Another option would be something like,

data = parse(...)
result = run_foo(data, ...)
update_data!(data, result["solution"])
print_metrics(data)

This is even more flexible because print_metrics can be called on any data, before or after a solve.

BTW, have you tried the print_summary(data)/print_summary(data["solution"]) feature? It should be working with GasModels and I find it's a great way to quickly inspect results in the REPL.

Do you think either of these would be a good fit for your use case?

@rb004f
Copy link
Collaborator Author

rb004f commented May 1, 2020

the print functions look like a good substitute. The resolution of this issue will be dropping support for this feature.

@ccoffrin
Copy link
Member

ccoffrin commented May 1, 2020

Great!

@ccoffrin ccoffrin modified the milestone: Register version 1.0 May 1, 2020
@ccoffrin
Copy link
Member

ccoffrin commented May 1, 2020

@kaarthiksundar, can we get this into the v0.7 release?

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

No branches or pull requests

2 participants