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

get_groups documentation #1256

Open
jd-lara opened this issue Jan 19, 2025 · 0 comments
Open

get_groups documentation #1256

jd-lara opened this issue Jan 19, 2025 · 0 comments
Assignees

Comments

@jd-lara
Copy link
Member

jd-lara commented Jan 19, 2025

          The functionality in get_groups combined with groupby is very powerful and clever. However, the documentation is a bit lacking.
  1. I understand how these capabilities are used in PowerAnalytics.jl. Let's take an example where you want to sum active_power for generators grouped by fuel type. We need this functionality merged ASAP. 100% agree and let's do it.
  2. If this is to be a public interface that we expect users to use, the documentation needs improvement. At minimum, there should be a complete workflow example. Common questions will be, "what is the difference between groupby = :each and groupby = :all? What is an example of a function that should be passed? This leaves me with three conflicting opinions. (1) Leave it alone with the understanding that very few people will ever consider this. (2) Don't export this method. (3) Go all in and give complete documentation.
  3. Once a power user understands what's going on here, they are likely to ask why we did all this. They might say, why not rely on existing packages, like this example
using DataFrames
julia> combine(groupby(DataFrame(get_components(ThermalStandard, sys)), :fuel), :active_power => sum)
5×2 DataFrame
 Row │ fuel                               active_power_sum 
     │ ThermalF…                          Float64          
─────┼─────────────────────────────────────────────────────
   1 │ ThermalFuels.NATURAL_GAS = 7              29.7472
   2 │ ThermalFuels.COAL = 1                     13.6381
   3 │ ThermalFuels.DISTILLATE_FUEL_OIL…          6.5
   4 │ ThermalFuels.OTHER = 14                    0.0
   5 │ ThermalFuels.NUCLEAR = 9                   0.849257

If we go all in on documentation, we should anticipate this question and address it.

Originally posted by @daniel-thom in #1197 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants