File tree Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Expand file tree Collapse file tree 1 file changed +11
-16
lines changed Original file line number Diff line number Diff line change 55
66
77def make_spectrum (value = None , lambda_min = None , lambda_max = None ):
8- from mitsuba .core .xml import load_string
8+ from mitsuba .core .xml import load_dict
9+
10+ dict_spectrum = {"type" : "uniform" }
11+
12+ if value is not None :
13+ dict_spectrum ["value" ] = value
14+ if lambda_min is not None :
15+ dict_spectrum ["lambda_min" ] = lambda_min
16+ if lambda_max is not None :
17+ dict_spectrum ["lambda_max" ] = lambda_max
918
10- xml_value = f"""<float name="value" value="{ value } "/>""" \
11- if value is not None else ""
12- xml_lambda_min = f"""<float name="lambda_min" value="{ lambda_min } "/>""" \
13- if lambda_min is not None else ""
14- xml_lambda_max = f"""<float name="lambda_max" value="{ lambda_max } "/>""" \
15- if lambda_max is not None else ""
16-
17- xml_spectrum = f"""
18- <spectrum version="2.0.0" type="uniform">
19- { xml_value }
20- { xml_lambda_min }
21- { xml_lambda_max }
22- </spectrum>
23- """
24- return load_string (xml_spectrum )
19+ return load_dict (dict_spectrum )
2520
2621
2722def test_construct (variant_scalar_spectral ):
You can’t perform that action at this time.
0 commit comments