pydae 0.56.4__py3-none-any.whl → 0.57__py3-none-any.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.
- pydae/__init__.py +1 -1
- pydae/bmapu/bmapu_builder.py +681 -681
- pydae/bmapu/bmapu_builder_line_exp.py +564 -0
- pydae/bmapu/lines/lib_dtr.py +425 -0
- pydae/bmapu/lines/lines.py +237 -1
- pydae/bmapu/lines/temp.py +1823 -0
- pydae/bmapu/lines/temp_ini_cffi.c +1280 -0
- pydae/bmapu/lines/temp_run_cffi.c +1280 -0
- pydae/bmapu/lines/temp_trap_cffi.c +971 -0
- pydae/bmapu/lines/temp_xy_0.json +7 -0
- pydae/bmapu/lines/xy_0.json +7 -0
- pydae/bmapu/pvs/pv_string.py +647 -0
- pydae/build_cffi.py +1 -1
- pydae/build_v2.py +29 -18
- pydae/models/pendulum/api_test.http +106 -0
- pydae/models/pendulum/dae_api.py +107 -0
- pydae/models/pendulum/dashboard.py +211 -0
- pydae/models/pendulum/temp.py +1882 -0
- pydae/models/pendulum/temp_ini_cffi.c +1247 -0
- pydae/models/pendulum/temp_run_cffi.c +1247 -0
- pydae/models/pendulum/temp_trap_cffi.c +950 -0
- pydae/svg_tools/bmapu_tooltips.ipynb +119 -0
- pydae/svg_tools/svg_tools.py +11 -4
- pydae/temp.py +1 -1
- pydae/temp_ini_cffi.c +4 -0
- pydae/temp_run_cffi.c +4 -0
- pydae/temp_trap_cffi.c +4 -0
- pydae/templates/class_dae_template_api.py +1857 -0
- pydae/utils/dates.py +233 -0
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/METADATA +4 -2
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/RECORD +34 -15
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info}/WHEEL +1 -1
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info/licenses}/COPYING +0 -0
- {pydae-0.56.4.dist-info → pydae-0.57.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": null,
|
|
6
|
+
"id": "4916d61e",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [],
|
|
9
|
+
"source": [
|
|
10
|
+
"from pydae.utils import read_data\n",
|
|
11
|
+
"from xml.etree.ElementTree import Element\n",
|
|
12
|
+
"import numpy as np"
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"cell_type": "code",
|
|
17
|
+
"execution_count": 3,
|
|
18
|
+
"id": "87764463",
|
|
19
|
+
"metadata": {},
|
|
20
|
+
"outputs": [],
|
|
21
|
+
"source": [
|
|
22
|
+
"grid_data = read_data('grid_data.hjson')"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"cell_type": "code",
|
|
27
|
+
"execution_count": 5,
|
|
28
|
+
"id": "afb311d8",
|
|
29
|
+
"metadata": {},
|
|
30
|
+
"outputs": [
|
|
31
|
+
{
|
|
32
|
+
"data": {
|
|
33
|
+
"text/plain": [
|
|
34
|
+
"[OrderedDict([('name', 'POI'),\n",
|
|
35
|
+
" ('P_W', 0),\n",
|
|
36
|
+
" ('Q_var', 0),\n",
|
|
37
|
+
" ('U_kV', 20),\n",
|
|
38
|
+
" ('monitor', True),\n",
|
|
39
|
+
" ('fdii', True)]),\n",
|
|
40
|
+
" OrderedDict([('name', 'POIHV'),\n",
|
|
41
|
+
" ('P_W', 0),\n",
|
|
42
|
+
" ('Q_var', 0),\n",
|
|
43
|
+
" ('U_kV', 132),\n",
|
|
44
|
+
" ('monitor', True),\n",
|
|
45
|
+
" ('fdii', True)]),\n",
|
|
46
|
+
" OrderedDict([('name', 'GRID'),\n",
|
|
47
|
+
" ('P_W', 0),\n",
|
|
48
|
+
" ('Q_var', 0),\n",
|
|
49
|
+
" ('U_kV', 132),\n",
|
|
50
|
+
" ('monitor', True)]),\n",
|
|
51
|
+
" OrderedDict([('name', 'BESS'),\n",
|
|
52
|
+
" ('P_W', 0),\n",
|
|
53
|
+
" ('Q_var', 0),\n",
|
|
54
|
+
" ('U_kV', 0.8),\n",
|
|
55
|
+
" ('monitor', True)]),\n",
|
|
56
|
+
" OrderedDict([('name', 'SS1LV'),\n",
|
|
57
|
+
" ('P_W', 0),\n",
|
|
58
|
+
" ('Q_var', 0),\n",
|
|
59
|
+
" ('U_kV', 0.8),\n",
|
|
60
|
+
" ('monitor', True)]),\n",
|
|
61
|
+
" OrderedDict([('name', 'SS1'),\n",
|
|
62
|
+
" ('P_W', 0),\n",
|
|
63
|
+
" ('Q_var', 0),\n",
|
|
64
|
+
" ('U_kV', 20),\n",
|
|
65
|
+
" ('monitor', True),\n",
|
|
66
|
+
" ('fdii', True)]),\n",
|
|
67
|
+
" OrderedDict([('name', 'SS2LV'),\n",
|
|
68
|
+
" ('P_W', 0),\n",
|
|
69
|
+
" ('Q_var', 0),\n",
|
|
70
|
+
" ('U_kV', 0.8),\n",
|
|
71
|
+
" ('monitor', True)]),\n",
|
|
72
|
+
" OrderedDict([('name', 'SS2'),\n",
|
|
73
|
+
" ('P_W', 0),\n",
|
|
74
|
+
" ('Q_var', 0),\n",
|
|
75
|
+
" ('U_kV', 20),\n",
|
|
76
|
+
" ('monitor', True),\n",
|
|
77
|
+
" ('fdii', True)])]"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"execution_count": 5,
|
|
81
|
+
"metadata": {},
|
|
82
|
+
"output_type": "execute_result"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"source": [
|
|
86
|
+
"grid_data['buses']"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"cell_type": "code",
|
|
91
|
+
"execution_count": null,
|
|
92
|
+
"id": "349525c8",
|
|
93
|
+
"metadata": {},
|
|
94
|
+
"outputs": [],
|
|
95
|
+
"source": []
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"metadata": {
|
|
99
|
+
"kernelspec": {
|
|
100
|
+
"display_name": "base",
|
|
101
|
+
"language": "python",
|
|
102
|
+
"name": "python3"
|
|
103
|
+
},
|
|
104
|
+
"language_info": {
|
|
105
|
+
"codemirror_mode": {
|
|
106
|
+
"name": "ipython",
|
|
107
|
+
"version": 3
|
|
108
|
+
},
|
|
109
|
+
"file_extension": ".py",
|
|
110
|
+
"mimetype": "text/x-python",
|
|
111
|
+
"name": "python",
|
|
112
|
+
"nbconvert_exporter": "python",
|
|
113
|
+
"pygments_lexer": "ipython3",
|
|
114
|
+
"version": "3.11.7"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"nbformat": 4,
|
|
118
|
+
"nbformat_minor": 5
|
|
119
|
+
}
|
pydae/svg_tools/svg_tools.py
CHANGED
|
@@ -534,8 +534,15 @@ class animatesvg():
|
|
|
534
534
|
def set_size(self,width,height):
|
|
535
535
|
self.root.attrib['width'] = f'{width}px'
|
|
536
536
|
self.root.attrib['height'] = f'{height}px'
|
|
537
|
-
|
|
538
|
-
def
|
|
537
|
+
|
|
538
|
+
def rotate_group(self,group_id):
|
|
539
|
+
|
|
540
|
+
for item in self.g_list:
|
|
541
|
+
if item.attrib['id'] == self.group_id:
|
|
542
|
+
pass
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
def rotate_animation(self,times,angle,x,y):
|
|
539
546
|
if type(x) == float:
|
|
540
547
|
x = times*0+x
|
|
541
548
|
if type(y) == float:
|
|
@@ -572,7 +579,7 @@ class animatesvg():
|
|
|
572
579
|
anim.set('keyTimes',f"{keyTimes}")
|
|
573
580
|
item.insert(0, anim)
|
|
574
581
|
|
|
575
|
-
def
|
|
582
|
+
def translate_animation(self,times,x,y):
|
|
576
583
|
t_end = times[-1]
|
|
577
584
|
N_t = len(times)
|
|
578
585
|
keyTimes = ""
|
|
@@ -604,7 +611,7 @@ class animatesvg():
|
|
|
604
611
|
anim.set('keyTimes',f"{keyTimes}")
|
|
605
612
|
item.insert(0, anim)
|
|
606
613
|
|
|
607
|
-
def
|
|
614
|
+
def scale_animation(self,times,x_0,y_0,sx,sy):
|
|
608
615
|
t_end = times[-1]
|
|
609
616
|
N_t = len(times)
|
|
610
617
|
keyTimes = ""
|
pydae/temp.py
CHANGED
|
@@ -98,7 +98,7 @@ class model:
|
|
|
98
98
|
self.params_list = ['L', 'G', 'M', 'K_d']
|
|
99
99
|
self.params_values_list = [5.21, 9.81, 10.0, 0.001]
|
|
100
100
|
self.inputs_ini_list = ['theta', 'u_dummy']
|
|
101
|
-
self.inputs_ini_values_list = [0.08726646259971647, 0.0]
|
|
101
|
+
self.inputs_ini_values_list = [np.float64(0.08726646259971647), 0.0]
|
|
102
102
|
self.inputs_run_list = ['f_x', 'u_dummy']
|
|
103
103
|
self.inputs_run_values_list = [0, 0.0]
|
|
104
104
|
self.outputs_list = ['E_p', 'E_k', 'f_x', 'lam']
|
pydae/temp_ini_cffi.c
CHANGED
|
@@ -281,11 +281,15 @@ static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
|
|
|
281
281
|
typedef unsigned char _Bool;
|
|
282
282
|
# endif
|
|
283
283
|
# endif
|
|
284
|
+
# define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
|
|
285
|
+
# define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
|
|
284
286
|
#else
|
|
285
287
|
# include <stdint.h>
|
|
286
288
|
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
|
|
287
289
|
# include <alloca.h>
|
|
288
290
|
# endif
|
|
291
|
+
# define _cffi_float_complex_t float _Complex
|
|
292
|
+
# define _cffi_double_complex_t double _Complex
|
|
289
293
|
#endif
|
|
290
294
|
|
|
291
295
|
#ifdef __GNUC__
|
pydae/temp_run_cffi.c
CHANGED
|
@@ -281,11 +281,15 @@ static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
|
|
|
281
281
|
typedef unsigned char _Bool;
|
|
282
282
|
# endif
|
|
283
283
|
# endif
|
|
284
|
+
# define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
|
|
285
|
+
# define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
|
|
284
286
|
#else
|
|
285
287
|
# include <stdint.h>
|
|
286
288
|
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
|
|
287
289
|
# include <alloca.h>
|
|
288
290
|
# endif
|
|
291
|
+
# define _cffi_float_complex_t float _Complex
|
|
292
|
+
# define _cffi_double_complex_t double _Complex
|
|
289
293
|
#endif
|
|
290
294
|
|
|
291
295
|
#ifdef __GNUC__
|
pydae/temp_trap_cffi.c
CHANGED
|
@@ -281,11 +281,15 @@ static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
|
|
|
281
281
|
typedef unsigned char _Bool;
|
|
282
282
|
# endif
|
|
283
283
|
# endif
|
|
284
|
+
# define _cffi_float_complex_t _Fcomplex /* include <complex.h> for it */
|
|
285
|
+
# define _cffi_double_complex_t _Dcomplex /* include <complex.h> for it */
|
|
284
286
|
#else
|
|
285
287
|
# include <stdint.h>
|
|
286
288
|
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
|
|
287
289
|
# include <alloca.h>
|
|
288
290
|
# endif
|
|
291
|
+
# define _cffi_float_complex_t float _Complex
|
|
292
|
+
# define _cffi_double_complex_t double _Complex
|
|
289
293
|
#endif
|
|
290
294
|
|
|
291
295
|
#ifdef __GNUC__
|