Skip to content

Commit

Permalink
Rename profile files for assets and flows (#669)
Browse files Browse the repository at this point in the history
* Change assets profile name and schemas

* Change flows profile name and schemas

* Include comments from review

Co-authored-by: Abel Soares Siqueira <nepper271@gmail.com>

---------

Co-authored-by: Abel Soares Siqueira <nepper271@gmail.com>
  • Loading branch information
datejada and abelsiqueira committed Jun 26, 2024
1 parent 3dc9a16 commit 5aee7e5
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/src/how-to-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ The meaning of `Missing` data depends on the parameter, for instance:

- `investment_limit`: There is no investment limit.

#### [`assets-timeframe-profiles.csv` and `assets-rep-periods-profiles.csv`] (@id assets-profiles-definition)
#### [`assets-timeframe-profiles.csv` and `assets-profiles.csv`] (@id assets-profiles-definition)

These files contain information about assets and their associated profiles. Each row lists an asset, the type of profile (e.g., availability, demand, maximum or minimum storage level), and the profile's name. The timeframe profiles are used in the [inter-temporal constraints](@ref concepts-summary), whereas the representative periods profiles are used in the [intra-temporal constraints](@ref concepts-summary).

#### [`flows-rep-periods-profiles.csv`](@id flows-profiles-definition)
#### [`flows-profiles.csv`](@id flows-profiles-definition)

This file contains information about flows and their representative period profiles for intra-temporal constraints. Each flow is defined as a pair of assets.

#### `profiles-timeframe-<type>.csv` and `profiles-rep-periods-<type>.csv`

One of these files must exist for each `type` defined in either [`assets-rep-periods-profiles`](@ref assets-profiles-definition) or [`flows-rep-periods-profiles`](@ref flows-profiles-definition). For example, if the file [`assets-rep-periods-profiles`](@ref assets-profiles-definition) defines an availability profile, the file `profiles-rep-periods-availability.csv` includes the profile data. The files store the profile data as indexed by a profile name.
One of these files must exist for each `type` defined in either [`assets-profiles`](@ref assets-profiles-definition) or [`flows-profiles`](@ref flows-profiles-definition). For example, if the file [`assets-profiles`](@ref assets-profiles-definition) defines an availability profile, the file `profiles-rep-periods-availability.csv` includes the profile data. The files store the profile data as indexed by a profile name.

#### [`assets-rep-periods-partitions.csv`](@id assets-rep-periods-partitions-definition)

Expand Down
4 changes: 2 additions & 2 deletions src/input-schemas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ const schema_per_file = OrderedDict(
"assets_timeframe_partitions" => schemas.assets.timeframe_partition,
"assets_data" => schemas.assets.data,
"assets_timeframe_profiles" => schemas.assets.profiles_reference,
"assets_rep_periods_profiles" => schemas.assets.profiles_reference,
"assets_profiles" => schemas.assets.profiles_reference,
"assets_rep_periods_partitions" => schemas.assets.rep_periods_partition,
"flows_data" => schemas.flows.data,
"flows_rep_periods_profiles" => schemas.flows.profiles_reference,
"flows_profiles" => schemas.flows.profiles_reference,
"flows_rep_periods_partitions" => schemas.flows.rep_periods_partition,
"profiles_timeframe_<type>" => schemas.timeframe.profiles_data,
"profiles_rep_periods_<type>" => schemas.rep_periods.profiles_data,
Expand Down
9 changes: 5 additions & 4 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ The following tables are expected to exist in the DB.
_ `assets_timeframe_partitions`: Following the schema `schemas.assets.timeframe_partition`.
_ `assets_data`: Following the schema `schemas.assets.data`.
_ `assets_timeframe_profiles`: Following the schema `schemas.assets.profiles_reference`.
_ `assets_rep_periods_profiles`: Following the schema `schemas.assets.profiles_reference`.
_ `assets_profiles`: Following the schema `schemas.assets.profiles_reference`.
_ `assets_rep_periods_partitions`: Following the schema `schemas.assets.rep_periods_partition`.
_ `flows_data`: Following the schema `schemas.flows.data`.
_ `flows_rep_periods_profiles`: Following the schema `schemas.flows.profiles_reference`.
_ `flows_profiles`: Following the schema `schemas.flows.profiles_reference`.
_ `flows_rep_periods_partitions`: Following the schema `schemas.flows.rep_periods_partition`.
_ `profiles_timeframe_<type>`: Following the schema `schemas.timeframe.profiles_data`.
_ `profiles_rep_periods_<type>`: Following the schema `schemas.rep_periods.profiles_data`.
Expand Down Expand Up @@ -105,9 +105,10 @@ function create_input_dataframes(connection::DuckDB.DB; strict = false)
df_rp_mapping = read_table("rep_periods_mapping")

dfs_assets_profiles = Dict(
period_type => read_table("assets_$(period_type)_profiles") for period_type in PERIOD_TYPES
:rep_periods => read_table("assets_profiles"),
:timeframe => read_table("assets_timeframe_profiles"),
)
df_flows_profiles = read_table("flows_rep_periods_profiles")
df_flows_profiles = read_table("flows_profiles")
dfs_assets_partitions = Dict(
period_type => read_table("assets_$(period_type)_partitions") for
period_type in PERIOD_TYPES
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 5aee7e5

Please sign in to comment.