Skip to content

Commit 7d2b81b

Browse files
committed
added prior visibility setting for projects
1 parent 66acc5d commit 7d2b81b

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
@@ -713,6 +713,30 @@ def get_contrast_model_field(self):
713713
model_field = "custom_files"
714714
return model_field
715715

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

0 commit comments

Comments
 (0)