Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMB Likelihood #69

Open
NickHunt-Smith opened this issue May 31, 2022 · 0 comments
Open

CMB Likelihood #69

NickHunt-Smith opened this issue May 31, 2022 · 0 comments

Comments

@NickHunt-Smith
Copy link

It seems that there is an issue with the yaml dumper when using the newly-added CMB likelihood test function:

File "rejection_sampling.py", line 91, in
experiment.run(function, finish_line=1000)
File "/home/nicholas/.local/lib/python3.8/site-packages/high_dimensional_sampling/experiments.py", line 247, in run
self._perform_experiment(function, log_data)
File "/home/nicholas/.local/lib/python3.8/site-packages/high_dimensional_sampling/experiments.py", line 88, in _perform_experiment
self.logger.log_experiment(self, function)
File "/home/nicholas/.local/lib/python3.8/site-packages/high_dimensional_sampling/experiments.py", line 620, in log_experiment
yaml.dump(info, handle, default_flow_style=False)
File "/usr/lib/python3/dist-packages/yaml/init.py", line 290, in dump
return dump_all([data], stream, Dumper=Dumper, **kwds)
File "/usr/lib/python3/dist-packages/yaml/init.py", line 278, in dump_all
dumper.represent(data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 27, in represent
node = self.represent_data(data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 48, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 207, in represent_dict
return self.represent_mapping('tag:yaml.org,2002:map', data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 118, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 48, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 207, in represent_dict
return self.represent_mapping('tag:yaml.org,2002:map', data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 118, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 48, in represent_data
node = self.yaml_representers[data_types[0]](self, data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 207, in represent_dict
return self.represent_mapping('tag:yaml.org,2002:map', data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 118, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 52, in represent_data
node = self.yaml_multi_representers[data_type](self, data)
File "/usr/lib/python3/dist-packages/yaml/representer.py", line 317, in represent_object
reduce = data.reduce_ex(2)
File "stringsource", line 2, in classy.Class.reduce_cython
TypeError: no default reduce due to non-trivial cinit

For now I've just commented out the yaml dumper in line 619 of experiments.py.

Also just a heads up for the rejection sampling example, to find the right ranges for the CMB likelihood it should be ranges = function.ranges not ranges = function.get_ranges(0.01). check_testfunction should have also have function as an attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant