33
44import numpy as np
55
6- import imaspy
6+ import imas
77
88from .utils import (
99 available_backends ,
@@ -22,16 +22,16 @@ def fill_slices(core_profiles, times):
2222 """Fill a time slice of a core_profiles IDS with generated data.
2323
2424 Args:
25- core_profiles: core_profiles IDS (either from IMASPy or AL HLI)
25+ core_profiles: core_profiles IDS (either from imas-python or AL HLI)
2626 times: time values to fill a slice for
2727 """
2828 core_profiles .ids_properties .homogeneous_time = 1 # HOMOGENEOUS
29- core_profiles .ids_properties .comment = "Generated for the IMASPy benchmark suite"
29+ core_profiles .ids_properties .comment = "Generated for the imas-python benchmark suite"
3030 core_profiles .ids_properties .creation_date = datetime .date .today ().isoformat ()
31- core_profiles .code .name = "IMASPy ASV benchmark"
32- core_profiles .code .version = imaspy .__version__
31+ core_profiles .code .name = "imas-python ASV benchmark"
32+ core_profiles .code .version = imas .__version__
3333 core_profiles .code .repository = (
34- "https://git.iter.org/projects/IMAS/repos/imaspy/browse "
34+ "https://github.com/iterorganization/imas-python "
3535 )
3636
3737 core_profiles .time = np .array (times )
@@ -50,7 +50,14 @@ def fill_slices(core_profiles, times):
5050 profiles_1d .ion .resize (len (ions ))
5151 profiles_1d .neutral .resize (len (ions ))
5252 for i , ion in enumerate (ions ):
53- profiles_1d .ion [i ].label = profiles_1d .neutral [i ].label = ion
53+ if hasattr (profiles_1d .ion [i ], 'label' ):
54+ profiles_1d .ion [i ].label = ion
55+ profiles_1d .neutral [i ].label = ion
56+ if hasattr (profiles_1d .ion [i ], 'name' ):
57+ profiles_1d .ion [i ].name = ion
58+ profiles_1d .neutral [i ].name = ion
59+
60+ # profiles_1d.ion[i].label = profiles_1d.neutral[i].label = ion
5461 profiles_1d .ion [i ].z_ion = 1.0
5562 profiles_1d .ion [i ].neutral_index = profiles_1d .neutral [i ].ion_index = i + 1
5663
@@ -74,7 +81,7 @@ def setup(self, hli, backend):
7481
7582 def time_get_slice (self , hli , backend ):
7683 for t in TIME :
77- self .dbentry .get_slice ("core_profiles" , t , imaspy .ids_defs .CLOSEST_INTERP )
84+ self .dbentry .get_slice ("core_profiles" , t , imas .ids_defs .CLOSEST_INTERP )
7885
7986 def teardown (self , hli , backend ):
8087 if hasattr (self , "dbentry" ): # imas + netCDF has no dbentry
@@ -96,8 +103,8 @@ class LazyGet:
96103 param_names = ["lazy" , "backend" ]
97104
98105 def setup (self , lazy , backend ):
99- self .dbentry = create_dbentry ("imaspy " , backend )
100- core_profiles = factory ["imaspy " ].core_profiles ()
106+ self .dbentry = create_dbentry ("imas " , backend )
107+ core_profiles = factory ["imas " ].core_profiles ()
101108 fill_slices (core_profiles , TIME )
102109 self .dbentry .put (core_profiles )
103110
0 commit comments