Skip to content

Commit cf422a7

Browse files
committed
added prior visibility setting for projects
1 parent cfbf683 commit cf422a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

RATapi/project.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,30 @@ def get_contrast_model_field(self):
718718
model_field = "custom_files"
719719
return model_field
720720

721+
def set_prior_visibility(self, priors_visible: bool):
722+
"""Set whether priors are visible or invisible for all parameters.
723+
724+
Parameters
725+
----------
726+
priors_visible : bool
727+
Whether priors should be shown.
728+
729+
"""
730+
for classlist_name in parameter_class_lists:
731+
classlist = getattr(self, classlist_name)
732+
for i in range(0, len(classlist)):
733+
classlist[i].show_priors = priors_visible
734+
735+
def show_priors(self):
736+
"""Show priors for all parameters in the model."""
737+
# convenience function from set_prior_visibility
738+
self.set_prior_visibility(True)
739+
740+
def hide_priors(self):
741+
"""Hide priors for all parameters in the model."""
742+
# convenience function from set_prior_visibility
743+
self.set_prior_visibility(False)
744+
721745
def write_script(self, obj_name: str = "problem", script: str = "project_script.py"):
722746
"""Write a python script that can be run to reproduce this project object.
723747

0 commit comments

Comments
 (0)