diff --git a/LICENSE b/LICENSE index dc8b777ed503b24c83d0d5d51f0546a0426d0272..68b855ddd6c2856787a049179f4cf9a74aa221c8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2020, UT-Battelle, LLC. +Copyright (c) 2020-2025, UT-Battelle, LLC. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/requirements.txt b/requirements.txt index 7d34ab3a55a9c0782c75497ce06840e293d64fe8..9675befa65d2ad089d571c9279efecad66e9088b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ git+https://github.com/SASView/sasmodels.git -numpy==1.19.0 -scipy==1.5.2 -PyYAML==5.3.1 -matplotlib=3.2.2 +numpy +scipy +PyYAML +matplotlib diff --git a/sas_temper/__init__.py b/sas_temper/__init__.py index 2d51be09dc13fb857a0a9aea8945502e96a95c4b..ca67c49a9019ac26a23631225e7bdcf5aa8218f5 100644 --- a/sas_temper/__init__.py +++ b/sas_temper/__init__.py @@ -3,9 +3,9 @@ sas_temper __init__.py: some setup code to be called at the start of the program -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ - \ No newline at end of file + diff --git a/sas_temper/modelconfig.py b/sas_temper/modelconfig.py index a9ee0654b6e33fe1e4fe73ff98c6ddcaf2dd899e..d0666135dc0c632dcf8b66eb2d658db7f4d7ab76 100644 --- a/sas_temper/modelconfig.py +++ b/sas_temper/modelconfig.py @@ -10,7 +10,7 @@ modelconfig.py - a class that contains information about the model the profile calculation and output. Structure factors are parts of models, even though SASModels treats them as models. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/output.py b/sas_temper/output.py index d8b82cd5f57e55522cfd237feadcdc5e88b9d30b..922079c8efdcc9468d6a097b2c491e16ab2ec7e1 100644 --- a/sas_temper/output.py +++ b/sas_temper/output.py @@ -8,10 +8,11 @@ output.py: code for writing fitting results and the results of also outputs the final table of averages, standard deviations and the summary table of the models found during the fitting. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ +import matplotlib from matplotlib import pyplot as plt import numpy as np @@ -272,11 +273,34 @@ def outputSetRes(conf, res): plt.close(fig) - +#################################################### +# determine if we use "nonposx/y" or "nonpositive" # +# this was from sanstools' set of plotting gizmos # +#################################################### +def mpl_version(): + mplversion = str(matplotlib.__version__) + digs = mplversion.split(".") + + if int(digs[1])<3: + nonposx = True + else: + nonposx = False + + return nonposx + + def outputFitCurve(conf, d, m, mnum, chisq): + nonpos = mpl_version() + # buf = str(nonpos) + # print(buf) + fig, ax = plt.subplots() - ax.set_xscale("log", nonpositive='clip') - ax.set_yscale("log", nonpositive='clip') + if nonpos is True: + ax.set_xscale("log", nonposx='clip') + ax.set_yscale("log", nonposy='clip') + else: + ax.set_xscale("log", nonpositive='clip') + ax.set_yscale("log", nonpositive='clip') ax.set_autoscale_on(True) # set the plot title diff --git a/sas_temper/param.py b/sas_temper/param.py index 78678ad4c11bd74f33b63d1164ade9c640d84fa6..19595156a46cb9516d6dd573c8690fc1e84e94f8 100644 --- a/sas_temper/param.py +++ b/sas_temper/param.py @@ -16,7 +16,7 @@ param.py - model parameters for the simulated annlealing to be "Name" keyword. The structure factors that exist in SASModels also have parameter sets and the object will be reused there. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/parse_conf.py b/sas_temper/parse_conf.py index 3f753aa21e00f3d56dd30fc91a9a051997c5b4db..5424c4187a05a6649098ced1de0c76c2c5dbe8bb 100644 --- a/sas_temper/parse_conf.py +++ b/sas_temper/parse_conf.py @@ -6,7 +6,7 @@ parse_conf.py: code for parsing the YAML configuration file. for the fitting engine that is built on simulated annealing. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/polydispersity.py b/sas_temper/polydispersity.py index 683ffe4d23622b5d2bd27c7d1b391246444257f0..85b9664ee376e607998c0dcfee9d5076dd9eb236 100644 --- a/sas_temper/polydispersity.py +++ b/sas_temper/polydispersity.py @@ -16,7 +16,7 @@ polydispersity.py - a class for setting the polydispersity parameters are not acceptable because sas_temper is expected to run in a headless configuration. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/sas_calc.py b/sas_temper/sas_calc.py index ef3e1ffd58a8e7b13a583e6e24e0cfad92243bac..a5fcb3a740b297c9bce4c3ccd0a237b0d655f089 100644 --- a/sas_temper/sas_calc.py +++ b/sas_temper/sas_calc.py @@ -8,7 +8,7 @@ sa_calc.py: this code is for the intensity and chi-squared calculations. integral, but the code will be expanded to use the NIST Gaussian integration routine built into sasmodels. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/sas_data.py b/sas_temper/sas_data.py index f812d180498fb0f033f369ffa9c8297ad1a3a9a7..9da928fc9656fc5425f043c158bcde6915ce53ba 100644 --- a/sas_temper/sas_data.py +++ b/sas_temper/sas_data.py @@ -6,7 +6,7 @@ sa_data.py: this is a container class for the data that allows interest, which the sasmodels does not directly support in a clear manner. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/sas_temper_config.py b/sas_temper/sas_temper_config.py index 597b615e155a373bedd4aa5c729b2f8307372530..418be2cd34961205988663251d9b6a7cc9fd368a 100644 --- a/sas_temper/sas_temper_config.py +++ b/sas_temper/sas_temper_config.py @@ -5,7 +5,7 @@ sas_temper_config.py: code for parsing the YAML config file for sas_temper, which is a YAML 1.2 compliant file containing the information required for the program. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/sas_temper_engine.py b/sas_temper/sas_temper_engine.py index f7d36650636667f44a7385712f44b233285a74de..7876b32701b9bf9b39aebe579178a5e7f9d64e35 100644 --- a/sas_temper/sas_temper_engine.py +++ b/sas_temper/sas_temper_engine.py @@ -5,7 +5,7 @@ sas_temper_engine.py: The actual simulated annealing algorithm is here, as is the code for refinement process and the wrapper function that controls both. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper/structurefactor.py b/sas_temper/structurefactor.py index c2b59b897efe518cf576912434ab981a2cf57d2b..6e922594b7aedc4bcf489e7cf55cfceed4535a21 100644 --- a/sas_temper/structurefactor.py +++ b/sas_temper/structurefactor.py @@ -9,7 +9,7 @@ structurefactor.py - a class that specifies a structure factor for a the calculation. Once calculated, sas_temper multiplies F(q)*S(q) for I(q) to compare against the data. -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/sas_temper_env.yaml b/sas_temper_env.yaml index bedb4b11873483a358805016ae91d36332ebc632..2e0f3accbcd6e1bfbc91c6fa0a9c2f1461d7d8de 100644 --- a/sas_temper_env.yaml +++ b/sas_temper_env.yaml @@ -1,9 +1,8 @@ -name: sas_temper +name: sas_temper_dev dependencies: - pip - numpy -- nb_conda -- python=3.6 +- python - pip: - scipy - numpy diff --git a/scripts/sas-temper b/scripts/sas-temper index 0d2eabafab49912768cb872ffd29814ce031dd78..ee09132e7c12fa3836ba93edeaa077ebed147bbd 100644 --- a/scripts/sas-temper +++ b/scripts/sas-temper @@ -4,7 +4,7 @@ sas_temper __main__.py: this is where the action happens -Oak Ridge National Laboratory, 2020 +Oak Ridge National Laboratory, 2020-2025 """ diff --git a/setup.py b/setup.py index 598246ff7dee2b66ce87d844c387a66851f9b7fd..b86f4f6ef7a0c71b2f6f2df343ef540f242b5352 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def is_external_dependency(dependency): setup( name='sas_temper', - version='0.3.1', + version='0.4.0', description='SAS data analysis using simulated annealing and reproducibility characterization. Uses sasmodels package', packages=['sas_temper'], scripts=['scripts/sas-temper'],