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

Feature/link capacity added #18

Merged
merged 23 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5ea3783
Refactoring ts_generator.py (adding link capacity class)
mehdiwahada Oct 28, 2024
6bfd0bd
Refactoring ts_generator.py (adding link capacity class)
mehdiwahada Oct 28, 2024
785dce4
correcting dependencies problem
mehdiwahada Oct 29, 2024
cde74a1
reformating imports
mehdiwahada Oct 29, 2024
249f526
reformating imports
mehdiwahada Oct 29, 2024
c06ae57
reformating imports
mehdiwahada Oct 29, 2024
08473fb
reformating imports
mehdiwahada Oct 29, 2024
c4b1dee
reformating imports
mehdiwahada Oct 29, 2024
ab5c787
reformating imports
mehdiwahada Oct 29, 2024
a52d692
reformating imports
mehdiwahada Oct 29, 2024
f40ea27
Correcting ThermalCLuster arguments
mehdiwahada Oct 29, 2024
f54675b
Correcting ThermalCLuster arguments
mehdiwahada Oct 29, 2024
27c7758
Correcting ThermalCLuster arguments
mehdiwahada Oct 29, 2024
9fffa9a
Correcting ThermalCLuster arguments
mehdiwahada Oct 29, 2024
8bc9f27
Including link unit testing and refactoring
mehdiwahada Oct 30, 2024
1d18234
Correcting variable name in unit testing cases
mehdiwahada Oct 30, 2024
a9e8ca4
Correcting variable name in unit testing cases
mehdiwahada Oct 30, 2024
5707a65
Working on correcting minor problems
mehdiwahada Oct 30, 2024
6b3e8a9
Working on correcting minor problems
mehdiwahada Oct 30, 2024
8383cd2
Working on correcting minor problems
mehdiwahada Oct 30, 2024
7a2d082
Working on correcting minor problems
mehdiwahada Oct 30, 2024
863e95a
Working on correcting minor problems
mehdiwahada Oct 31, 2024
a8e799d
Working on correcting minor problems
mehdiwahada Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ rng = MersenneTwisterRNG()
```

Then perform the timeseries generation:

```python
generator = ThermalDataGenerator(rng=rng, days=days)
results = generator.generate_time_series(cluster, 1)
results = generator.generate_time_series_for_clusters(cluster, 1)
```

The actual timeseries for the total available power of the cluster are available in
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ matplotlib>=3.5.1
mypy~=1.7.1
pandas-stubs
pytest-cov
pytest~=7.0.0
pytest~=8.3.3
MartinBelthle marked this conversation as resolved.
Show resolved Hide resolved
types-PyYAML
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
numpy==1.24.4
pandas
pydantic
PyYAML
pandas~=2.2.3
MartinBelthle marked this conversation as resolved.
Show resolved Hide resolved
pydantic~=2.9.2
PyYAML~=6.0.2
pytest~=8.3.3
matplotlib~=3.9.2
11 changes: 7 additions & 4 deletions src/antares/tsgen/cluster_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import numpy as np

from .ts_generator import ProbabilityLaw, ThermalCluster
from .ts_generator import OutageGenerationParameters, ProbabilityLaw, ThermalCluster


def import_thermal_cluster(path: Path, days_per_year: int = 365) -> ThermalCluster:
Expand All @@ -24,10 +24,8 @@ def import_thermal_cluster(path: Path, days_per_year: int = 365) -> ThermalClust
}
array = np.genfromtxt(path, delimiter=",", dtype=str)
hourly_modulation = np.tile(array[3][1 : 24 + 1].astype(int), 365)
return ThermalCluster(
outage_gen_params = OutageGenerationParameters(
unit_count=int(array[1][1]),
nominal_power=float(array[2][1]),
modulation=hourly_modulation,
fo_law=law_dict[array[4][1]],
fo_volatility=float(array[5][1]),
po_law=law_dict[array[6][1]],
Expand All @@ -39,3 +37,8 @@ def import_thermal_cluster(path: Path, days_per_year: int = 365) -> ThermalClust
npo_min=array[12][1 : days_per_year + 1].astype(int),
npo_max=array[13][1 : days_per_year + 1].astype(int),
)
return ThermalCluster(
outage_gen_params,
nominal_power=float(array[2][1]),
modulation=hourly_modulation,
)
11 changes: 7 additions & 4 deletions src/antares/tsgen/cluster_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandas as pd

from .cluster_parsing import InputCluster
from .ts_generator import ProbabilityLaw, ThermalCluster
from .ts_generator import OutageGenerationParameters, ProbabilityLaw, ThermalCluster


def resolve_thermal_cluster(
Expand All @@ -25,10 +25,8 @@ def resolve_thermal_cluster(
"UNIFORM": ProbabilityLaw.UNIFORM,
"GEOMETRIC": ProbabilityLaw.GEOMETRIC,
}
return ThermalCluster(
outage_gen_params = OutageGenerationParameters(
unit_count=parsed_yaml.unit_count,
nominal_power=parsed_yaml.nominal_power,
modulation=modulation["modulation"].to_numpy(dtype=float),
fo_law=law_dict[parsed_yaml.fo_law],
fo_volatility=parsed_yaml.fo_volatility,
po_law=law_dict[parsed_yaml.po_law],
Expand All @@ -40,3 +38,8 @@ def resolve_thermal_cluster(
npo_min=parameters_ts["POMax"].to_numpy(dtype=int),
npo_max=parameters_ts["POMin"].to_numpy(dtype=int),
)
return ThermalCluster(
outage_gen_params,
nominal_power=parsed_yaml.nominal_power,
modulation=modulation["modulation"].to_numpy(dtype=float),
)
Loading