MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / ensure_list

Function ensure_list

Tools/Postprocessing/python/parseparticles.py:278–290  ·  view source on GitHub ↗

make sure an object is a list; used, for example, when a single file is passed into the parseParticleFile method

(obj)

Source from the content-addressed store, hash-verified

276
277#------------------------------------------------------------------------
278def ensure_list(obj):
279 """
280 make sure an object is a list; used, for example, when a single
281 file is passed into the parseParticleFile method
282 """
283
284 import types
285
286 if obj is None:
287 return [obj]
288 if not isinstance(obj, types.ListType):
289 return [obj]
290 return obj
291
292
293

Callers 1

parseParticleFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected