Skip to content

Commit 7ffccd4

Browse files
Add xmile vector funcs
1 parent f8c5b81 commit 7ffccd4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pysd/builders/python/python_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"sum": ("sum(%(0)s, dim=%(axis)s)", (("functions", "sum"),)),
3636
"vmax": ("vmax(%(0)s, dim=%(axis)s)", (("functions", "vmax"),)),
3737
"vmin": ("vmin(%(0)s, dim=%(axis)s)", (("functions", "vmin"),)),
38+
"mean": ("np.mean(%(0)s)", (("numpy",),)),
39+
"stddev": ("np.std(%(0)s)", (("numpy",),)),
40+
"sum_xmile": ("sum(%(0)s)", (("functions", "sum"),)),
3841
"vmax_xmile": ("vmax(%(0)s)", (("functions", "vmax"),)),
3942
"vmin_xmile": ("vmin(%(0)s)", (("functions", "vmin"),)),
4043
"vector_select": (

pysd/translators/xmile/xmile_structures.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
ae.ReferenceStructure("Xpulse_train"), (start, interval, magnitude)
7070
)
7171
},
72+
"sum": lambda x: ae.CallStructure(
73+
ae.ReferenceStructure("sum_xmile"), (x,)),
7274
"max": {
7375
1: lambda x: ae.CallStructure(
7476
ae.ReferenceStructure("vmax_xmile"), (x,)),

0 commit comments

Comments
 (0)