From 81763ab646ad1d492d20aaa8f72f32d2fdefe34b Mon Sep 17 00:00:00 2001 From: Andrej Prsa Date: Wed, 27 Mar 2024 22:42:12 -0400 Subject: [PATCH 1/3] run_checks_compute() bugfix The run_checks_compute() function included the internal "_default" compute parameter set in checking the ck2004 model atmosphere table existence in the passband files. This caused the checks to fail even if ck2004 was never needed. --- phoebe/frontend/bundle.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phoebe/frontend/bundle.py b/phoebe/frontend/bundle.py index 8f924ef44..0cdd52195 100644 --- a/phoebe/frontend/bundle.py +++ b/phoebe/frontend/bundle.py @@ -1,6 +1,7 @@ import sys import subprocess import os +import numpy as np try: from subprocess import DEVNULL @@ -3753,6 +3754,7 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No all_pbs = list_passbands(full_dict=True) online_pbs = list_online_passbands(full_dict=True) + # TODO: is this robust against flipping constraints? pb_needs_ext = self.get_value(qualifier='ebv', context='system', **_skip_filter_checks) != 0 for pbparam in self.filter(qualifier='passband', **_skip_filter_checks).to_list(): @@ -3765,11 +3767,12 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No pb_needs_Inorm = True pb_needs_Imu = True - pb_needs_ld = True #np.any([p.get_value()!='interp' for p in self.filter(qualifier='ld_mode', dataset=pbparam.dataset, context='dataset', **_skip_filter_checks).to_list()]) + pb_needs_ld = True pb_needs_ldint = True missing_pb_content = [] + # TODO: do we really want to run this every time we run checks? Perhaps move to init? if pb_needs_ext and pb in ['Stromgren:u', 'Johnson:U', 'SDSS:u', 'SDSS:uprime']: # need to check for bugfix in coefficients from 2.3.4 release installed_timestamp = installed_pbs.get(pb, {}).get('timestamp', None) @@ -3781,6 +3784,8 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No # NOTE: atms are not attached to datasets, but per-compute and per-component for atmparam in self.filter(qualifier='atm', kind='phoebe', compute=computes, **_skip_filter_checks).to_list() + self.filter(qualifier='ld_coeffs_source').to_list(): + if '_default' in atmparam.twig: + continue # check to make sure passband supports the selected atm atm = atmparam.get_value(**_skip_filter_checks) From fda6a2bc4919da40dfc715fed140955b660a1b5f Mon Sep 17 00:00:00 2001 From: Andrej Prsa Date: Thu, 28 Mar 2024 09:07:29 -0400 Subject: [PATCH 2/3] Incorporating @kecnry's comments into the PR (along with additional comments) --- phoebe/frontend/bundle.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/phoebe/frontend/bundle.py b/phoebe/frontend/bundle.py index 0cdd52195..95313edb2 100644 --- a/phoebe/frontend/bundle.py +++ b/phoebe/frontend/bundle.py @@ -3754,7 +3754,6 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No all_pbs = list_passbands(full_dict=True) online_pbs = list_online_passbands(full_dict=True) - # TODO: is this robust against flipping constraints? pb_needs_ext = self.get_value(qualifier='ebv', context='system', **_skip_filter_checks) != 0 for pbparam in self.filter(qualifier='passband', **_skip_filter_checks).to_list(): @@ -3772,7 +3771,6 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No missing_pb_content = [] - # TODO: do we really want to run this every time we run checks? Perhaps move to init? if pb_needs_ext and pb in ['Stromgren:u', 'Johnson:U', 'SDSS:u', 'SDSS:uprime']: # need to check for bugfix in coefficients from 2.3.4 release installed_timestamp = installed_pbs.get(pb, {}).get('timestamp', None) @@ -3783,10 +3781,10 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No True, 'run_compute') # NOTE: atms are not attached to datasets, but per-compute and per-component - for atmparam in self.filter(qualifier='atm', kind='phoebe', compute=computes, **_skip_filter_checks).to_list() + self.filter(qualifier='ld_coeffs_source').to_list(): - if '_default' in atmparam.twig: - continue - + # NOTE: atmparam includes a '_default' compute pset, which depends on the + # ck2004 atmospheres; the checks should not include it. This is achieved + # by filtering check_visible=True in the line below: + for atmparam in self.filter(qualifier='atm', kind='phoebe', compute=computes, check_visible=True, check_default=False).to_list() + self.filter(qualifier='ld_coeffs_source').to_list(): # check to make sure passband supports the selected atm atm = atmparam.get_value(**_skip_filter_checks) if atmparam.qualifier == 'ld_coeffs_source' and atm == 'auto': From 6fc6cb4ef5c16ac751e84cfd8e6457e2b250e1b2 Mon Sep 17 00:00:00 2001 From: Andrej Prsa Date: Thu, 28 Mar 2024 09:53:39 -0400 Subject: [PATCH 3/3] Fixing the if statement per @kecnry's instructions. --- phoebe/frontend/bundle.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phoebe/frontend/bundle.py b/phoebe/frontend/bundle.py index 95313edb2..a337e1f2d 100644 --- a/phoebe/frontend/bundle.py +++ b/phoebe/frontend/bundle.py @@ -1,7 +1,6 @@ import sys import subprocess import os -import numpy as np try: from subprocess import DEVNULL @@ -3783,8 +3782,8 @@ def run_checks_compute(self, compute=None, solver=None, solution=None, figure=No # NOTE: atms are not attached to datasets, but per-compute and per-component # NOTE: atmparam includes a '_default' compute pset, which depends on the # ck2004 atmospheres; the checks should not include it. This is achieved - # by filtering check_visible=True in the line below: - for atmparam in self.filter(qualifier='atm', kind='phoebe', compute=computes, check_visible=True, check_default=False).to_list() + self.filter(qualifier='ld_coeffs_source').to_list(): + # by filtering check_visible=False and check_default=True in the line below: + for atmparam in self.filter(qualifier='atm', kind='phoebe', compute=computes, check_visible=False, check_default=True).to_list() + self.filter(qualifier='ld_coeffs_source').to_list(): # check to make sure passband supports the selected atm atm = atmparam.get_value(**_skip_filter_checks) if atmparam.qualifier == 'ld_coeffs_source' and atm == 'auto':