Skip to content

Commit

Permalink
Merge pull request #36 from sstroemer/fix-issue-35
Browse files Browse the repository at this point in the history
fix: rely on JuliaSyntax's tokenize instead of regex-based splitting of strings during conversion to expr
  • Loading branch information
sstroemer authored Nov 27, 2024
2 parents d91f90e + 80f7605 commit 5f57289
Show file tree
Hide file tree
Showing 46 changed files with 152 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "IESopt"
uuid = "ed3f0a38-8ad9-4cf8-877e-929e8d190fe9"
version = "2.0.2"
version = "2.0.3"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/01_basic_single_node.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
# This specifies the overall type of optimization problem. If using "LP" like here, no component can utilize
# formulations that are of a "higher" class (e.g. MILP).
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/02_advanced_single_node.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/03_basic_two_nodes.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/04_soft_constraints.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/05_basic_two_nodes_1y.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/06_recursion_h2.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
10 changes: 5 additions & 5 deletions src/assets/examples/07_csv_filestorage.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down Expand Up @@ -63,8 +63,8 @@ components:
conversion: 1 wind -> 1 electricity
capacity: 10 out:electricity
# Instead of cluttering our YAML with 8760 entries, we now just load it from a CSV. This is done by supplying the
# correct column (07_plant_wind_availability_factor) that can be found in the CSV (data) like so:
availability_factor: 07_plant_wind_availability_factor@data
# correct column (ex07_plant_wind_availability_factor) that can be found in the CSV (data) like so:
availability_factor: ex07_plant_wind_availability_factor@data

plant_gas:
type: Unit
Expand All @@ -78,14 +78,14 @@ components:
carrier: electricity
node_from: node1
# Again, now loading from CSV.
value: 07_demand1_value@data
value: ex07_demand1_value@data

demand2:
type: Profile
carrier: electricity
node_from: node2
# Again, now loading from CSV.
value: 07_demand2_value@data
value: ex07_demand2_value@data

gas_grid:
type: Node
Expand Down
6 changes: 3 additions & 3 deletions src/assets/examples/08_basic_investment.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down Expand Up @@ -87,7 +87,7 @@ components:
outputs: {electricity: elec}
conversion: ~ -> 1 electricity
capacity: 1 out:electricity
availability_factor: 08_pv@data
availability_factor: ex08_pv@data

electrolysis:
type: Unit
Expand All @@ -100,6 +100,6 @@ components:
type: Profile
carrier: h2
node_from: h2_south
value: 08_demand@data
value: ex08_demand@data


2 changes: 1 addition & 1 deletion src/assets/examples/09_csv_only.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
6 changes: 3 additions & 3 deletions src/assets/examples/10_basic_load_shedding.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down Expand Up @@ -72,7 +72,7 @@ components:
outputs: {electricity: elec}
conversion: ~ -> 1 electricity
capacity: 1 out:electricity
availability_factor: 08_pv@data
availability_factor: ex08_pv@data

electrolysis:
type: Unit
Expand All @@ -85,7 +85,7 @@ components:
type: Profile
carrier: h2
node_from: h2_south
value: 08_demand@data
value: ex08_demand@data

# This allows the "reducing demand" (load shedding) by introducing a Profile that covers the missing energy.
shedding:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/11_basic_unit_commitment.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/12_incremental_efficiency.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
6 changes: 3 additions & 3 deletions src/assets/examples/15_varying_efficiency.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
snapshots:
Expand All @@ -25,7 +25,7 @@ components:
heatpump:
type: Unit
capacity: 100 out:heat
conversion: 1 electricity -> 15_cop@data heat
conversion: 1 electricity -> ex15_cop@data heat
conversion_at_min: 1 electricity -> 1 heat
min_conversion: 0.2
unit_commitment: binary
Expand All @@ -52,7 +52,7 @@ components:
carrier: heat
mode: fixed
node_from: heat_grid
value: 15_heatdemand@data
value: ex15_heatdemand@data

# We allow "throwing away heat" (essentially allowing the heat_demand to extend beyond the set value)
heat_demand_deviation:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/16_noncore_components.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
snapshots:
Expand Down Expand Up @@ -35,7 +35,7 @@ components:

conn:
type: Connection
capacity: 17_capacity@data
capacity: ex17_capacity@data
node_from: node1
node_to: node2

Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/18_addons.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/20_chp.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/22_snapshot_weights.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/23_snapshots_from_csv.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
snapshots:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/25_global_parameters.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters: files/25/global.iesopt.param.yaml
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/26_initial_states.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/27_piecewise_linear_costs.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
solver:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/31_exclusive_operation.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: LP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/32_sos.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/33_benders_investment.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/34_piecewise_linear_costs.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/35_fixed_costs.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/36_stochastic_investment.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config:
general:
version:
core: 2.0.2
core: 2.0.3
optimization:
problem_type: MILP
solver:
Expand Down
Loading

2 comments on commit 5f57289

@sstroemer
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/120300

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.0.3 -m "<description of version>" 5f572891feed1edd46d0d881f9af2117ce687769
git push origin v2.0.3

Please sign in to comment.