MCPcopy Create free account
hub / github.com/Cantera/cantera / as_dict

Method as_dict

test/python/test_units.py:100–107  ·  view source on GitHub ↗

Add the square brackets around the dimension for comparison with pint

(self)

Source from the content-addressed store, hash-verified

98 return Dimensions(name=new_name, **dimensionality)
99
100 def as_dict(self) -> Dict[str, float]:
101 """Add the square brackets around the dimension for comparison with pint"""
102 dimensionality = {}
103 for dimension in self.dimensions:
104 value = getattr(self, dimension)
105 if value is not None:
106 dimensionality[f"[{dimension}]"] = value
107 return dimensionality
108
109
110# Create instances of Dimensions that correspond to all the combinations of dimensions

Callers 2

yield_dimensionsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected