Skip to content

Commit 718b0b8

Browse files
authored
Removal of legacy constructor (#53)
1 parent 3fe120a commit 718b0b8

5 files changed

Lines changed: 5 additions & 77 deletions

File tree

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
### Minor updates
1313

1414
* Improved the documentation and unified the docstrings.
15+
* Removed error when `RegHydroStor` was still used as legacy constructor.
1516

1617
## Version 0.6.8 (2026-03-18)
1718

docs/src/how-to/update-models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Hence, there are frequently breaking changes occuring, although we plan to keep
55
This document is designed to provide users with information regarding how they have to adjust their models to keep compatibility to the latest changes.
66
We will as well implement information regarding the adjustment of extension packages, although this is more difficult due to the vast majority of potential changes.
77

8-
## Adjustments from 0.4.2
8+
## Adjustments from 0.5.x
99

1010
### Key changes for nodal descriptions
1111

@@ -94,7 +94,7 @@ PumpedHydroStor{CyclicStrategic}(
9494
)
9595
```
9696

97-
## Adjustments from 0.4.0 to 0.6.x
97+
## Adjustments from 0.4.x to 0.6.x
9898

9999
### Key changes for nodal descriptions
100100

docs/src/library/public.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ HydroPump
3030
HydroGate
3131
```
3232

33-
### [Legacy constructors](@id lib-pub-node-legacy)
34-
35-
```@docs
36-
RegHydroStor
37-
```
38-
3933
## [Additional types](@id lib-pub-add)
4034

4135
### [Providing a battery lifetime](@id lib-pub-add-bat_life)

src/EnergyModelsRenewableProducers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ include("legacy_constructor.jl")
4040
export AbstractNonDisRES, NonDisRES
4141

4242
# Simple hydro power types
43-
export HydroStorage, RegHydroStor, HydroStor, PumpedHydroStor
43+
export HydroStorage, HydroStor, PumpedHydroStor
4444

4545
# Detailed hydro power types
4646
export HydroReservoir, HydroGenerator, HydroPump, HydroGate

src/legacy_constructor.jl

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,4 @@
1-
"""
2-
RegHydroStor(
3-
id::Any,
4-
rate_cap::TimeProfile,
5-
stor_cap::TimeProfile,
6-
has_pump::Bool,
7-
level_init::TimeProfile,
8-
level_inflow::TimeProfile,
9-
level_min::TimeProfile,
10-
opex_var::TimeProfile,
11-
opex_fixed::TimeProfile,
12-
stor_res::ResourceCarrier,
13-
input,
14-
output,
15-
Data,
16-
)
17-
18-
Original Legacy constructor for a regulated hydropower storage, with or without pumping capabilities.
19-
This version is discontinued starting with Version 0.6.0. resulting in an error
20-
It is replaced with the two new types [`HydroStor`](@ref) and [`PumpedHydroStor`](@ref)
21-
to utilize the concept of multiple dispatch instead of logic.
22-
23-
See the *[documentation](https://energymodelsx.github.io/EnergyModelsRenewableProducers.jl/stable/how-to/update-models/#Adjustments-from-0.4.0-to-0.6.x)*
24-
for further information regarding how you can translate your existing model to the new model.
25-
26-
## Fields
27-
- **`id`** is the name/identifyer of the node.
28-
- **`rate_cap::TimeProfile`** is the installed installed rate capacity.
29-
- **`stor_cap::TimeProfile`** is the installed storage capacity in the dam.
30-
- **`has_pump::Bool`** states wheter the stored resource can flow in.
31-
- **`level_init::TimeProfile`** is the initial stored energy in the dam.
32-
- **`level_inflow::TimeProfile`** is the inflow of power per operational period.
33-
- **`level_min::TimeProfile`** is the minimum fraction of the reservoir capacity that
34-
has to remain in the `HydroStorage` node.
35-
- **`opex_var::TimeProfile`** are the variable operating expenses per GWh produced.
36-
- **`opex_fixed::TimeProfile`** are the fixed operational costs of the storage caacity.
37-
- **`stor_res::ResourceCarrier`** is the stored `Resource`.
38-
- **`input::Dict{Resource, Real}`** are the stored and used resources. The values in the Dict
39-
are ratios describing the energy loss when using the pumps.
40-
- **`output::Dict{Resource, Real}`** can only contain one entry, the stored resource.
41-
- **`data::Array{Data}`** additional data (e.g. for investments). This value is conditional
42-
through the application of a constructor.
43-
"""
44-
function RegHydroStor(
45-
id::Any,
46-
rate_cap::TimeProfile,
47-
stor_cap::TimeProfile,
48-
has_pump::Bool,
49-
level_init::TimeProfile,
50-
level_inflow::TimeProfile,
51-
level_min::TimeProfile,
52-
opex_var::TimeProfile,
53-
opex_fixed::TimeProfile,
54-
stor_res::ResourceCarrier,
55-
input,
56-
output,
57-
Data,
58-
)
59-
@error(
60-
"This implementation of a `RegHydroStor` will be discontinued in the near future.
61-
It is replaced with the type
62-
- `PumpedHydroStor` when considering a pumped hydro storage node or
63-
- `HydroStor` for a standard regulated hydro power plant.
64-
You can find the individual fields of these types in the documentation."
65-
)
66-
end
67-
68-
"""
1+
"""
692
HydroStor(
703
id::Any,
714
rate_cap::TimeProfile,

0 commit comments

Comments
 (0)