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

Database columns documentation #350

Open
maurerle opened this issue May 8, 2024 · 0 comments
Open

Database columns documentation #350

maurerle opened this issue May 8, 2024 · 0 comments

Comments

@maurerle
Copy link
Member

maurerle commented May 8, 2024

One can use eralchemy2 to create mermaid plots like the one below:

classDiagram
class power_plant_meta{
   DOUBLE PRECISION efficiency
   DOUBLE PRECISION emission_factor
   TEXT index
   DOUBLE PRECISION max_power
   DOUBLE PRECISION min_power
   TEXT node
   TEXT simulation
   TEXT technology
   TEXT unit_operator
}
class demand_meta{
   TEXT index
   DOUBLE PRECISION max_power
   DOUBLE PRECISION min_power
   TEXT node
   TEXT simulation
   TEXT technology
   TEXT unit_operator
}
class market_meta{
   DOUBLE PRECISION demand_volume
   DOUBLE PRECISION demand_volume_energy
   BIGINT index
   TEXT market_id
   DOUBLE PRECISION max_price
   DOUBLE PRECISION min_price
   TEXT node
   TEXT only_hours
   DOUBLE PRECISION price
   TIMESTAMP product_end
   TIMESTAMP product_start
   TEXT simulation
   DOUBLE PRECISION supply_volume
   DOUBLE PRECISION supply_volume_energy
   TIMESTAMP time
}
class market_dispatch{
   TIMESTAMP datetime
   BIGINT index
   TEXT market_id
   DOUBLE PRECISION power
   TEXT simulation
   TEXT unit_id
}
class kpis{
   TEXT ident
   TEXT simulation
   DOUBLE PRECISION value
   TEXT variable
}
class market_orders{
   DOUBLE PRECISION accepted_price
   DOUBLE PRECISION accepted_volume
   TEXT bid_id
   TEXT bid_type
   TEXT block_id
   TIMESTAMP end_time
   TEXT exclusive_id
   TEXT link
   TEXT market_id
   DOUBLE PRECISION max_power
   DOUBLE PRECISION min_power
   TEXT node
   DOUBLE PRECISION price
   TEXT simulation
   TIMESTAMP start_time
   TEXT unit_id
   DOUBLE PRECISION volume
}
class storage_meta{
   DOUBLE PRECISION efficiency_charge
   DOUBLE PRECISION efficiency_discharge
   TEXT index
   DOUBLE PRECISION max_power_charge
   DOUBLE PRECISION max_power_discharge
   DOUBLE PRECISION min_power_charge
   DOUBLE PRECISION min_power_discharge
   TEXT node
   TEXT simulation
   TEXT technology
   TEXT unit_operator
}
class unit_dispatch{
   DOUBLE PRECISION demand_volume
   DOUBLE PRECISION demand_volume_energy
   DOUBLE PRECISION energy_cashflow
   DOUBLE PRECISION energy_marginal_costs
   TIMESTAMP index
   TEXT market_id
   DOUBLE PRECISION max_price
   DOUBLE PRECISION min_price
   TEXT node
   TEXT only_hours
   DOUBLE PRECISION power
   DOUBLE PRECISION price
   TEXT product_end
   TEXT product_start
   TEXT simulation
   TEXT snapshot
   DOUBLE PRECISION soc
   DOUBLE PRECISION supply_volume
   DOUBLE PRECISION supply_volume_energy
   TEXT time
   DOUBLE PRECISION total_costs
   TEXT unit
}
class rl_params{
   DOUBLE PRECISION actions_0
   DOUBLE PRECISION actions_1
   TIMESTAMP datetime
   BIGINT episode
   BOOLEAN evaluation_mode
   DOUBLE PRECISION exploration_noise_0
   DOUBLE PRECISION exploration_noise_1
   BOOLEAN learning_mode
   DOUBLE PRECISION profit
   DOUBLE PRECISION regret
   DOUBLE PRECISION reward
   TEXT simulation
   TEXT unit
}
Loading

For this one needs to run:

pip install eralchemy2
eralchemy2 -i "postgresql://assume:assume@localhost:5432/assume" -o "asssume_er.md"

(one needs to have graphviz installed or install eralchemy2 from conda though)

We could add something like this to our CI pipeline and update the ER diagram automatically.

@kim-mskw @nick-harder what do you think about that?

@maurerle maurerle changed the title Output documentation Database columns documentation May 8, 2024
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

1 participant