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

Cannot output initializer with start point #1031

Closed
Jammy2211 opened this issue Jul 31, 2024 · 0 comments
Closed

Cannot output initializer with start point #1031

Jammy2211 opened this issue Jul 31, 2024 · 0 comments
Assignees

Comments

@Jammy2211
Copy link
Collaborator

On the following MLE PR:

#1029

The following example:

https://github.com/Jammy2211/autofit_workspace/blob/release/scripts/searches/start_point.py

Gives the following error:

2024-07-31 20:16:17,444 - autofit.non_linear.search.abstract_search - INFO - Starting non-linear search with 1 cores.
2024-07-31 20:16:17,445 - start_point - INFO - The output path of this fit is /mnt/c/Users/Jammy/Code/PyAuto/autofit_workspace/output/searches/start_point/c08aea3aa8a5f449fb0fe25f0063eed2
2024-07-31 20:16:17,446 - start_point - INFO - Outputting pre-fit files (e.g. model.info, visualization).
Traceback (most recent call last):
  File "/mnt/c/Users/Jammy/Code/PyAuto/autofit_workspace/scripts/searches/start_point.py", line 148, in <module>
    result = search.fit(model=model, analysis=analysis)
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/search/abstract_search.py", line 590, in fit
    self.pre_fit_output(
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/search/abstract_search.py", line 665, in pre_fit_output
    self.paths.save_all(
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/paths/directory.py", line 358, in save_all
    self.save_json("search", to_dict(self.search))
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoConf/autoconf/output.py", line 61, in wrapper
    return func(self, name, *args, **kwargs)
  File "/mnt/c/Users/Jammy/Code/PyAuto/PyAutoFit/autofit/non_linear/paths/directory.py", line 81, in save_json
    json.dump(object_dict, f, indent=4)
  File "/usr/lib/python3.10/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/usr/lib/python3.10/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.10/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  [Previous line repeated 2 more times]
  File "/usr/lib/python3.10/json/encoder.py", line 376, in _iterencode_dict
    raise TypeError(f'keys must be str, int, float, bool or None, '
TypeError: keys must be str, int, float, bool or None, not UniformPrior

This is because starting points use priors in a dict, which are not supporrted by autoconf.

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

2 participants