psr-factory 4.1.0b10__py3-none-win_amd64.whl → 5.0.0b1__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- psr/cloud/cloud.py +351 -28
- psr/factory/__init__.py +1 -1
- psr/factory/api.py +5 -0
- psr/factory/factory.dll +0 -0
- psr/factory/factory.pmd +322 -37
- psr/factory/factory.pmk +378 -52
- psr/factory/libcurl-x64.dll +0 -0
- psr/factory/samples/{sddp_sample_case01.py → sddp_case01.py} +6 -5
- psr/factory/samples/{sddp_sample_case21.py → sddp_case21.py} +4 -3
- {psr_factory-4.1.0b10.dist-info → psr_factory-5.0.0b1.dist-info}/METADATA +3 -3
- {psr_factory-4.1.0b10.dist-info → psr_factory-5.0.0b1.dist-info}/RECORD +14 -15
- psr/factory/samples/sddp_1_stage_case01.py +0 -169
- {psr_factory-4.1.0b10.dist-info → psr_factory-5.0.0b1.dist-info}/WHEEL +0 -0
- {psr_factory-4.1.0b10.dist-info → psr_factory-5.0.0b1.dist-info}/licenses/LICENSE.txt +0 -0
- {psr_factory-4.1.0b10.dist-info → psr_factory-5.0.0b1.dist-info}/top_level.txt +0 -0
@@ -9,11 +9,12 @@ def get_case_path() -> str:
|
|
9
9
|
return os.path.join(os.path.splitext(os.path.basename(__file__))[0], "")
|
10
10
|
|
11
11
|
|
12
|
-
def
|
12
|
+
def create_case01(legacy: bool) -> psr.factory.Study:
|
13
13
|
blocks = 1
|
14
|
+
model = "SDDP" if not legacy else "SDDP17"
|
14
15
|
# Create a study object and define its basic settings.
|
15
16
|
study = psr.factory.create_study({
|
16
|
-
"Models": [
|
17
|
+
"Models": [model, ], # Default model: SDDP
|
17
18
|
"Blocks": blocks, # Default number of blocks: 1
|
18
19
|
"StageType": 2, # Weekly: 1 (default), Monthly: 2
|
19
20
|
})
|
@@ -103,7 +104,7 @@ def create_sddp_sample_case01() -> psr.factory.Study:
|
|
103
104
|
study.add(fuel2)
|
104
105
|
|
105
106
|
# Create all thermal plants.
|
106
|
-
plant1 =
|
107
|
+
plant1 = study.create("ThermalPlant")
|
107
108
|
plant1.code = 1
|
108
109
|
plant1.name = "Thermal 1"
|
109
110
|
# Set plant's properties
|
@@ -124,6 +125,7 @@ def create_sddp_sample_case01() -> psr.factory.Study:
|
|
124
125
|
"RefSystem": system,
|
125
126
|
}
|
126
127
|
plant1.from_dict(t_params)
|
128
|
+
study.add(plant1)
|
127
129
|
|
128
130
|
# Use Python copy's module copy function to create
|
129
131
|
# a copy of an object.
|
@@ -153,11 +155,10 @@ def create_sddp_sample_case01() -> psr.factory.Study:
|
|
153
155
|
|
154
156
|
|
155
157
|
if __name__ == "__main__":
|
156
|
-
|
157
158
|
case_path = get_case_path()
|
158
159
|
os.makedirs(case_path, exist_ok=True)
|
159
160
|
print("Creating example case... ", end="")
|
160
|
-
study =
|
161
|
+
study = create_case01(False)
|
161
162
|
print(" OK.")
|
162
163
|
print("Saving example case in \"{}\"... ".format(case_path), end="")
|
163
164
|
study.save(case_path)
|
@@ -9,14 +9,15 @@ def get_case_path() -> str:
|
|
9
9
|
return os.path.join(os.path.splitext(os.path.basename(__file__))[0], "")
|
10
10
|
|
11
11
|
|
12
|
-
def
|
12
|
+
def create_case21(legacy: bool) -> psr.factory.Study:
|
13
13
|
# Create a study object and define its basic settings.
|
14
14
|
blocks = 1
|
15
|
+
model = "SDDP" if not legacy else "SDDP17"
|
15
16
|
# A context defines the dimensions of the study and the meaning of
|
16
17
|
# its stages. You can only share or copy data from one study to another
|
17
18
|
# if they share the same context.
|
18
19
|
context = psr.factory.get_new_context()
|
19
|
-
context.set("Models", [
|
20
|
+
context.set("Models", [model, ]) # Default model: Sddp
|
20
21
|
context.set("Blocks", blocks) # Default number of blocks: 3
|
21
22
|
context.set("StageType", 2) # Weekly: 1, Monthly: 2 (default)
|
22
23
|
|
@@ -234,7 +235,7 @@ if __name__ == "__main__":
|
|
234
235
|
case_path = get_case_path()
|
235
236
|
os.makedirs(case_path, exist_ok=True)
|
236
237
|
print("Creating example case... ", end="")
|
237
|
-
study =
|
238
|
+
study = create_case21(False)
|
238
239
|
print(" OK.")
|
239
240
|
print("Saving example case in \"{}\"... ".format(case_path), end="")
|
240
241
|
study.save(case_path)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: psr-factory
|
3
|
-
Version:
|
3
|
+
Version: 5.0.0b1
|
4
4
|
Summary: PSR database management module.
|
5
5
|
Author-email: "PSR Inc." <psrfactory@psr-inc.com>
|
6
6
|
License-Expression: MIT
|
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE.txt
|
25
25
|
Dynamic: license-file
|
26
26
|
|
27
|
-
PSR Factory (version
|
27
|
+
PSR Factory (version 5.0.0b1)
|
28
28
|
============================
|
29
29
|
|
30
30
|
Factory is a library that helps to manage SDDP cases.
|
@@ -45,7 +45,7 @@ pip install psr-factory
|
|
45
45
|
Or, if the package directly from the wheel (whl) file:
|
46
46
|
|
47
47
|
```bash
|
48
|
-
pip install psr_factory-
|
48
|
+
pip install psr_factory-5.0.0b1-py3-none-win_amd64.whl
|
49
49
|
```
|
50
50
|
|
51
51
|
Factory will be available to all Python scripts in your system after importing it:
|
@@ -2,7 +2,7 @@ psr/apps/__init__.py,sha256=frSq1WIy5vIdU21xJIGX7U3XoAZRj0pcQmFb-R00b7I,228
|
|
2
2
|
psr/apps/apps.py,sha256=8jVxTFZ73KFk_PbY-8rZDD8HBONdCjt-jzsDJyu2P50,6921
|
3
3
|
psr/apps/version.py,sha256=vs459L6JsatAkUxna7BNG-vMCaXpO1Ye8c1bmkEx4U4,194
|
4
4
|
psr/cloud/__init__.py,sha256=inZMwG7O9Fca9hg1BhqYObOYtTTJOkpuTIuXnkHJZkI,246
|
5
|
-
psr/cloud/cloud.py,sha256=
|
5
|
+
psr/cloud/cloud.py,sha256=wEi_gUJkdS1s5SozaGVII6zdyYMFLLQkvi1ouCa_Smc,57344
|
6
6
|
psr/cloud/data.py,sha256=3zWh1qnBNFfI8K3N8jZKqDnzHWMQ5llc_wwGMZ4FtKs,3548
|
7
7
|
psr/cloud/desktop.py,sha256=JFroCMEFV1Nz3has74n7OVrGCg2lS7Ev5bcjdw2hRxY,2980
|
8
8
|
psr/cloud/log.py,sha256=Dvhz1enIWlFWeaRK7JAAuZVPfODgoEIRNcHEmbEliyQ,1366
|
@@ -10,26 +10,25 @@ psr/cloud/status.py,sha256=vcI4B9S6wCt9maT5NNrVwYaEgGIvy6kkC1UVpJjYbtw,3607
|
|
10
10
|
psr/cloud/tempfile.py,sha256=1IOeye0eKWnmBynK5K5FMWiTaEVhn4GbQ8_y0THEva0,3893
|
11
11
|
psr/cloud/version.py,sha256=RG2RB_TfKD_2sF3BR3PpbFPEmlXkWUJOgqpsnMmcVsc,192
|
12
12
|
psr/cloud/xml.py,sha256=dmBh4iRieORCctm1obz1EGA2QN-KkZlH5_dQfBud-AI,1847
|
13
|
-
psr/factory/__init__.py,sha256=
|
14
|
-
psr/factory/api.py,sha256=
|
15
|
-
psr/factory/factory.dll,sha256=
|
16
|
-
psr/factory/factory.pmd,sha256=
|
17
|
-
psr/factory/factory.pmk,sha256=
|
13
|
+
psr/factory/__init__.py,sha256=nPeJZw4RnzmdBNr2kBhEnDrrbO5pciX55tTbrUATTg4,218
|
14
|
+
psr/factory/api.py,sha256=N5153ZJmZjzLQ0AvRZnSlTu6UmHBQqbYw0UQ69sZHkE,98705
|
15
|
+
psr/factory/factory.dll,sha256=b708lQU_J2zQ-XQ8LYKLC_W5fVLu2jOemndQ1CrjD5g,13027088
|
16
|
+
psr/factory/factory.pmd,sha256=Ma9gT-K4fSyQHN-mlmGyukk24fr0w51T0HVvczfOhgo,238710
|
17
|
+
psr/factory/factory.pmk,sha256=Px4YBSwfMbWNkRlEVITYC6Zl2lsrm_NQ4w3eilVZf5Q,579459
|
18
18
|
psr/factory/factorylib.py,sha256=xnhCFTo4DpU0e5oHtIWMmc-kk6ThtNAUI3cxpDXrBKE,27497
|
19
|
-
psr/factory/libcurl-x64.dll,sha256=
|
19
|
+
psr/factory/libcurl-x64.dll,sha256=Lx3vh3ZyXXAfUIMhgVEoyfZNmrQkf7ZUOtcTPt5CCcU,5317904
|
20
20
|
psr/factory/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
21
21
|
psr/factory/samples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
psr/factory/samples/
|
23
|
-
psr/factory/samples/
|
24
|
-
psr/factory/samples/sddp_sample_case21.py,sha256=La9I6PcyEUCXDJMB0Mtn98Pl2V0RGPMEHAhGpboPvU8,8757
|
22
|
+
psr/factory/samples/sddp_case01.py,sha256=jo71p9NN7dtRqMT76TEbD4S4Lut7p4ejbpu6SoSwg0Y,5034
|
23
|
+
psr/factory/samples/sddp_case21.py,sha256=-9Wk2ntjIC1-PrQDXDcnWUjV0OF9Xi_IREFb2pUWSi4,8797
|
25
24
|
psr/psrfcommon/__init__.py,sha256=WXR560XQllIjtFpWd0jiJEbUAQIyh5-6lwj-42_J95c,200
|
26
25
|
psr/psrfcommon/psrfcommon.py,sha256=NABM5ahvyfSizDC9c0Vu9dVK1pD_vOzIGFHL1oz2E1o,1464
|
27
26
|
psr/psrfcommon/tempfile.py,sha256=5S13wa2DCLYTUdwbLm_KMBRnDRJ0WDlu8GO2BmZoNdg,3939
|
28
27
|
psr/runner/__init__.py,sha256=kI9HDX-B_LMQJUHHylFHas2rNpWfNNa0pZXoIvX_Alw,230
|
29
28
|
psr/runner/runner.py,sha256=xmo8YtrVvR4wzTHmnEeWxZzBQb9oRgg3bK_sPAGBcko,26599
|
30
29
|
psr/runner/version.py,sha256=mch2Y8anSXGMn9w72Z78PhSRhOyn55EwaoLAYhY4McE,194
|
31
|
-
psr_factory-
|
32
|
-
psr_factory-
|
33
|
-
psr_factory-
|
34
|
-
psr_factory-
|
35
|
-
psr_factory-
|
30
|
+
psr_factory-5.0.0b1.dist-info/licenses/LICENSE.txt,sha256=N6mqZK2Ft3iXGHj-by_MHC_dJo9qwn0URjakEPys3H4,1089
|
31
|
+
psr_factory-5.0.0b1.dist-info/METADATA,sha256=jaAWrN4AZdeOUo9imt2iNpWcZYyrEHpq7EMZDH2OssU,2426
|
32
|
+
psr_factory-5.0.0b1.dist-info/WHEEL,sha256=ZjXRCNaQ9YSypEK2TE0LRB0sy2OVXSszb4Sx1XjM99k,97
|
33
|
+
psr_factory-5.0.0b1.dist-info/top_level.txt,sha256=Jb393O96WQk3b5D1gMcrZBLKJJgZpzNjTPoldUi00ck,4
|
34
|
+
psr_factory-5.0.0b1.dist-info/RECORD,,
|
@@ -1,169 +0,0 @@
|
|
1
|
-
"""Creates SDDP 1 stage Case01 example."""
|
2
|
-
import copy
|
3
|
-
import os
|
4
|
-
|
5
|
-
import psr.factory
|
6
|
-
|
7
|
-
|
8
|
-
def get_case_path() -> str:
|
9
|
-
return os.path.join(os.path.splitext(os.path.basename(__file__))[0], "")
|
10
|
-
|
11
|
-
|
12
|
-
def create_sddp_sample_case01() -> psr.factory.Study:
|
13
|
-
blocks = 1
|
14
|
-
# Create a study object and define its basic settings.
|
15
|
-
study = psr.factory.create_study({
|
16
|
-
"Models": ["SDDP", ], # Default model: SDDP
|
17
|
-
"Blocks": blocks, # Default number of blocks: 1
|
18
|
-
"StageType": 2, # Weekly: 1 (default), Monthly: 2
|
19
|
-
})
|
20
|
-
study.from_dict({
|
21
|
-
"Description": "Caso ejemplo - DT - 1 etapa - 1 bloque",
|
22
|
-
"InitialYear": 2013,
|
23
|
-
"InitialStage": 1,
|
24
|
-
"NumberOfStages": 1,
|
25
|
-
"NumberOfSeries": 1,
|
26
|
-
})
|
27
|
-
|
28
|
-
# Study options
|
29
|
-
study.from_dict({
|
30
|
-
"Type": 2,
|
31
|
-
"InitialYearOfHydrology": 1996,
|
32
|
-
"NumberOfSystems": 1,
|
33
|
-
"AggregateInTheOperationPolicy": 0,
|
34
|
-
"UMON": "$",
|
35
|
-
"LoadSheddingInBuses": 0,
|
36
|
-
"MonitoringOfCircuitLimits": 0,
|
37
|
-
"HourlyRepresentation": 0,
|
38
|
-
"MaximumNumberOfIterations": 10,
|
39
|
-
"MinimumOutflowPenaltyHm3": 5000.0,
|
40
|
-
"DeficitSegment": [100.0, 0.0, 0.0, 0.0],
|
41
|
-
"DeficitCost": [500.0, 0.0, 0.0, 0.0],
|
42
|
-
"FutureCostStage": 4,
|
43
|
-
"FutureCostYear": 1998,
|
44
|
-
})
|
45
|
-
|
46
|
-
# Study duration
|
47
|
-
study.set("FixedDurationOfBlocks(1)", 100.0)
|
48
|
-
|
49
|
-
# By default, a study comes with one system.
|
50
|
-
system = study.get("System")[0]
|
51
|
-
system.code = 1
|
52
|
-
system.id = "s1"
|
53
|
-
system.name = "System 1"
|
54
|
-
# System's currency
|
55
|
-
system.set("SystemCurrency", "$")
|
56
|
-
# It's not required to add an existing object to the study.
|
57
|
-
|
58
|
-
# Set study to run with this unique system
|
59
|
-
study.set("CodesOfPowerSystems", [1, ])
|
60
|
-
|
61
|
-
# Create a demand segment - it's required to add at least
|
62
|
-
# an inelastic segment to a demand object.
|
63
|
-
segment = psr.factory.create("DemandSegment", study.context)
|
64
|
-
# Set demand and cost data.
|
65
|
-
segment.set_at("EnergyPerBlock(:)", "01/2013", 8.928)
|
66
|
-
# Add segment to the study.
|
67
|
-
study.add(segment)
|
68
|
-
|
69
|
-
# Create a system demand.
|
70
|
-
demand = psr.factory.create("Demand", study.context)
|
71
|
-
demand.code = 1
|
72
|
-
demand.name = "System 1"
|
73
|
-
# Associate it with the only system in the case.
|
74
|
-
demand.set("RefSystem", system)
|
75
|
-
# Associate the demand with its segments.
|
76
|
-
demand.set("RefSegments", [segment, ])
|
77
|
-
# Add demand to the study.
|
78
|
-
study.add(demand)
|
79
|
-
|
80
|
-
# Create all fuels - Thermal plants requires then.
|
81
|
-
fuel1 = psr.factory.create("Fuel", study.context)
|
82
|
-
fuel1.code = 1
|
83
|
-
fuel1.name = "Fuel 1"
|
84
|
-
fuel1.from_dict({
|
85
|
-
"Unit": "UC",
|
86
|
-
"UE": "MWh",
|
87
|
-
"Price": 0.8,
|
88
|
-
"EmissionFactor": 0.0,
|
89
|
-
"RefSystem": system,
|
90
|
-
})
|
91
|
-
study.add(fuel1)
|
92
|
-
|
93
|
-
fuel2 = psr.factory.create("Fuel", study.context)
|
94
|
-
fuel2.code = 2
|
95
|
-
fuel2.name = "Fuel 2"
|
96
|
-
fuel2.from_dict({
|
97
|
-
"Unit": "UC",
|
98
|
-
"UE": "MWh",
|
99
|
-
"Price": 1.2,
|
100
|
-
"EmissionFactor": 0.0,
|
101
|
-
"RefSystem": system,
|
102
|
-
})
|
103
|
-
study.add(fuel2)
|
104
|
-
|
105
|
-
# Create all thermal plants.
|
106
|
-
plant1 = psr.factory.create("ThermalPlant", study.context)
|
107
|
-
plant1.code = 1
|
108
|
-
plant1.name = "Thermal 1"
|
109
|
-
# Set plant's properties
|
110
|
-
t_params = {
|
111
|
-
"MaximumGenerationCapacity": 10.0,
|
112
|
-
"InstalledCapacity": 10.0,
|
113
|
-
"ThermalType": 0,
|
114
|
-
"Type": 0,
|
115
|
-
"NumberOfGeneratingUnits": 1,
|
116
|
-
"NumberOfAlternativeFuels": 0,
|
117
|
-
"CodeOfAlternativeFuels(:)": 0,
|
118
|
-
"O&MCost": 0.0,
|
119
|
-
"FuelTransportationCost": 0.0,
|
120
|
-
"SpecificConsumptionSegment(1)": 100.0,
|
121
|
-
"SpecificConsumptionSegment(2:3)": 0.0,
|
122
|
-
"SpecificConsumption(1:3,1)": 10.0,
|
123
|
-
"RefFuels": [fuel1, ],
|
124
|
-
"RefSystem": system,
|
125
|
-
}
|
126
|
-
plant1.from_dict(t_params)
|
127
|
-
for i in range(5):
|
128
|
-
pcopy = copy.copy(plant1)
|
129
|
-
pcopy.code = i + 1
|
130
|
-
study.add(pcopy)
|
131
|
-
|
132
|
-
|
133
|
-
# Use Python copy's module copy function to create
|
134
|
-
# a copy of an object.
|
135
|
-
plant2 = copy.copy(plant1)
|
136
|
-
plant2.code = 2
|
137
|
-
plant2.name = "Thermal 2"
|
138
|
-
plant2.set("MaximumGenerationCapacity", 5.0)
|
139
|
-
plant2.set("InstalledCapacity", 5.0)
|
140
|
-
plant2.set("SpecificConsumption(1:3,1)", 15.0)
|
141
|
-
plant2.set("RefFuels", [fuel1, ])
|
142
|
-
plant2.set("RefSystem", system)
|
143
|
-
study.add(plant2)
|
144
|
-
|
145
|
-
plant3 = plant2.clone()
|
146
|
-
plant3.code = 3
|
147
|
-
plant3.name = "Thermal 3"
|
148
|
-
plant3.from_dict({
|
149
|
-
"MaximumGenerationCapacity": 20.0,
|
150
|
-
"InstalledCapacity": 20.0,
|
151
|
-
"SpecificConsumption(1:3,1)": 12.5,
|
152
|
-
"RefFuels": [fuel2, ],
|
153
|
-
"RefSystem": system,
|
154
|
-
})
|
155
|
-
study.add(plant3)
|
156
|
-
|
157
|
-
return study
|
158
|
-
|
159
|
-
|
160
|
-
if __name__ == "__main__":
|
161
|
-
|
162
|
-
case_path = get_case_path()
|
163
|
-
os.makedirs(case_path, exist_ok=True)
|
164
|
-
print("Creating example case... ", end="")
|
165
|
-
study = create_sddp_sample_case01()
|
166
|
-
print(" OK.")
|
167
|
-
print("Saving example case in \"{}\"... ".format(case_path), end="")
|
168
|
-
study.save(case_path)
|
169
|
-
print(" OK.")
|
File without changes
|
File without changes
|
File without changes
|