Commit 4ce65c9f authored by mdoucet's avatar mdoucet
Browse files

Rename script sas-temper

parent a326b6c6
Loading
Loading
Loading
Loading

scripts/sas-temper

0 → 100644
+60 −0
Original line number Diff line number Diff line
#!/usr/bin/env python
"""
sas_temper

__main__.py:  this is where the action happens

Oak Ridge National Laboratory, 2020

"""

import sys
import copy
import time as tm
import os
import numpy as np
print(sys.path)

# these are from this particular project
import sas_temper
print(sas_temper.__file__)
import sas_temper.sas_temper_config as sa_config
import sas_temper.modelconfig as modelconfig
import sas_temper.parse_conf as parse_conf
import sas_temper.output as output
import sas_temper.sas_temper_engine as engine
import sas_temper.sas_data as sas_data

# will need to import material from sasview.src.sas.sascalc directories
#   the directories are all useful, but are not simple files in themselves


 # see if the program has been called correctly
if len(sys.argv) < 2:
    raise Exception("No configuration file was specified")

# parse the configuration file for the parameters
#modelConf = modelconfig.ModelConfig()
#sasTemperConf = sa_config.SAConfiguration()
sasTemperConf, modelConf = parse_conf.parse_config(sys.argv[1])

# Get the data from the data file
experimentalData = sas_data.SAData(sasTemperConf.datafile,sasTemperConf.qmin,sasTemperConf.qmax)

# This is the outer control loop to generate the set of results
results = np.empty(sasTemperConf.models, "object")
models = np.empty(sasTemperConf.models, "object")
models_usm = np.empty(sasTemperConf.models, "object")

# seed the random number generator
np.random.seed(int(tm.time()) + int(os.getpid()))

# this loop creates the set of models
for i in range(0,sasTemperConf.models):
    results[i], models[i], models_usm[i] = engine.sa_control(sasTemperConf,modelConf,experimentalData)

    #output the results of the single fitting
    output.outputSingleRes(sasTemperConf, experimentalData, models[i], i, results[i])

# and output the analysis of the set of models found
output.outputSetRes(sasTemperConf, results)
+3 −2
Original line number Diff line number Diff line
from setuptools import setup
from distutils.core import setup


REQUIREMENTS_DOT_TXT="requirements.txt"

@@ -24,7 +25,7 @@ setup(
    version='0.2.2',
    description='SAS data analysis using simulated annealing and reproducibility characterization.  Uses sasmodels package',
    packages=['sas_temper'],
    scripts=['scripts/sas_temper'],
    scripts=['scripts/sas-temper'],
    instal_requires=required_packages(),
    dependency_link=external_dependency_links(),
    package_data={'': [REQUIREMENTS_DOT_TXT]}