Update requirements. Split HDF5 compilation into its own virtual target.
This commit is contained in:
parent
1d261c6251
commit
aa42376cbe
9 changed files with 60 additions and 30 deletions
|
@ -515,7 +515,7 @@ def writeGadget(str filename, object simulation):
|
|||
|
||||
cxx_writeGadget(filename, &simdata)
|
||||
|
||||
def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision = False, bool loadPosition = True, bool loadVelocity = False, bool loadId = False):
|
||||
def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision = False, bool loadPosition = True, bool loadVelocity = False, bool loadId = False, bool loadMass = False):
|
||||
""" loadRamses(basepath, snapshot_id, cpu_id, doublePrecision = False, loadPosition = True, loadVelocity = False)
|
||||
Loads the indicated snapshot based on the cpu id, snapshot id and basepath. It is important to specify the correct precision in doublePrecision otherwise the loading will fail. There is no way of auto-detecting properly the precision of the snapshot file.
|
||||
|
||||
|
@ -528,7 +528,8 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision =
|
|||
doublePrecision (bool): By default it is False, thus singlePrecision
|
||||
loadPosition (bool): Whether to load positions
|
||||
loadVelocity (bool): Whether to load velocities
|
||||
loadId (bol): Whether to load identifiers
|
||||
loadId (bool): Whether to load identifiers
|
||||
loadMass (bool): Whether to load mass value
|
||||
|
||||
Returns:
|
||||
An object derived from PySimulationBase_.
|
||||
|
@ -544,13 +545,16 @@ def loadRamses(str basepath, int snapshot_id, int cpu_id, bool doublePrecision =
|
|||
flags |= NEED_VELOCITY
|
||||
if loadId:
|
||||
flags |= NEED_GADGET_ID
|
||||
if loadMass:
|
||||
flags |= NEED_MASS
|
||||
|
||||
encpath = basepath.encode('utf-8')
|
||||
try:
|
||||
data = loadRamsesSimu(basepath, snapshot_id, cpu_id, doublePrecision, flags)
|
||||
data = loadRamsesSimu(encpath, snapshot_id, cpu_id, doublePrecision, flags)
|
||||
if data == <SimuData*>0:
|
||||
return None
|
||||
except RuntimeError as e:
|
||||
raise RuntimeError(e.message + ' (check the float precision in snapshot)')
|
||||
raise RuntimeError(str(e) + ' (check the float precision in snapshot)')
|
||||
|
||||
return PySimulationAdaptor(wrap_simudata(data, flags))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue