Changeset fbb9397 in sasmodels for sasmodels/compare.py
- Timestamp:
- Oct 18, 2017 6:11:37 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 3c24ccd
- Parents:
- 32f87a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
r8698a0d rfbb9397 827 827 parameters. 828 828 """ 829 limits = np.Inf, -np.Inf830 829 for k in range(opts['sets']): 831 830 opts['pars'] = parse_pars(opts) … … 838 837 import matplotlib.pyplot as plt 839 838 plt.show() 839 return limits 840 840 841 841 def run_models(opts, verbose=False): … … 912 912 913 913 914 def plot_models(opts, result, limits= (np.Inf, -np.Inf), setnum=0):914 def plot_models(opts, result, limits=None, setnum=0): 915 915 # type: (Dict[str, Any], Dict[str, Any], Optional[Tuple[float, float]]) -> Tuple[float, float] 916 import matplotlib.pyplot as plt 917 916 918 base_value, comp_value = result['base_value'], result['comp_value'] 917 919 base_time, comp_time = result['base_time'], result['comp_time'] … … 925 927 # Plot if requested 926 928 view = opts['view'] 927 i mport matplotlib.pyplot as plt928 vmin, vmax = limits929 if have_base:930 vmin = min(vmin, base_value.min())931 vmax = max(vmax, base_value.max())932 if have_comp:933 vmin = min(vmin, comp_value.min())934 vmax = max(vmax, comp_value.max())935 limits = vmin, vmax929 if limits is None: 930 vmin, vmax = np.inf, -np.inf 931 if have_base: 932 vmin = min(vmin, base_value.min()) 933 vmax = max(vmax, base_value.max()) 934 if have_comp: 935 vmin = min(vmin, comp_value.min()) 936 vmax = max(vmax, comp_value.max()) 937 limits = vmin, vmax 936 938 937 939 if have_base: … … 1423 1425 self.starting_values = dict((k, v.value) for k, v in pars.items()) 1424 1426 self.pd_types = pd_types 1425 self.limits = np.Inf, -np.Inf1427 self.limits = None 1426 1428 1427 1429 def revert_values(self):
Note: See TracChangeset
for help on using the changeset viewer.