Changeset ce94504 in sasview


Ignore:
Timestamp:
Sep 10, 2016 1:54:34 PM (8 years ago)
Author:
gonzalezm
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
2fd2d99
Parents:
dceff6e (diff), fd196cb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of https://github.com/SasView/sasview

Files:
6 added
9 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    ra4974fa r58918de  
    1212  system_site_packages: true 
    1313before_install: 
    14   - 'if [ $TRAVIS_PYTHON_VERSION == "2.7" ]; then sudo apt-get update;sudo apt-get install python-numpy python-scipy python-matplotlib; fi' 
     14  - 'if [ $TRAVIS_PYTHON_VERSION == "2.7" ]; then sudo apt-get update;sudo apt-get install python-numpy python-scipy python-matplotlib libhdf5-serial-dev python-h5py fglrx opencl-headers python-pyopencl; fi' 
    1515 
    1616install: 
    1717  - pip install -r build_tools/requirements.txt 
     18 
     19before_script: 
     20  - "export DISPLAY=:99.0" 
     21  - "sh -e /etc/init.d/xvfb start" 
     22  - sleep 3 # give xvfb some time to start 
     23   
    1824script: 
    19   - export WORKSPACE=/home/travis/build/SasView/sasview/ 
     25  - export WORKSPACE=/home/travis/build/SasView/ 
     26  - cd $WORKSPACE 
     27  - git clone --depth=50 --branch=master https://github.com/SasView/sasmodels.git sasmodels 
    2028  - export PYTHONPATH=$WORKSPACE/sasview-install:$WORKSPACE/utils:$PYTHONPATH 
     29  - cd $WORKSPACE 
     30  - ls -ltr 
    2131  - if [ ! -d "utils" ]; then mkdir utils; fi 
    22   - /bin/sh -xe build_tools/jenkins_linux_build.sh 
    23   - /bin/sh -xe build_tools/jenkins_linux_test.sh 
     32  - /bin/sh -xe sasview/build_tools/travis_build.sh 
     33#  - /bin/sh -xe sasview/build_tools/jenkins_linux_test.sh 
    2434  - export LC_ALL=en_US.UTF-8 
    2535  - export LANG=en_US.UTF-8 
    26   - python setup.py docs; echo 0 
    27   - python setup.py bdist_egg --skip-build 
     36#  - python setup.py docs; echo 0 
     37#  - python setup.py bdist_egg --skip-build 
    2838 
  • sasview/__init__.py

    r86eb046 r4ac4caa  
    22__build__ = "GIT_COMMIT" 
    33try: 
     4    import logging 
    45    import subprocess 
    56    import os 
     7    import platform 
    68    FNULL = open(os.devnull, 'w') 
    7     git_revision = subprocess.check_output(['git', 'rev-parse', 'HEAD'], 
     9    if platform.system() == "Windows": 
     10        args = ['git', 'describe', '--tags'] 
     11    else: 
     12        args = ['git describe --tags'] 
     13    git_revision = subprocess.check_output(args, 
    814                    stderr=FNULL, 
    915                    shell=True) 
    1016    __build__ = str(git_revision).strip() 
    11 except: 
    12     import logging 
    13     import sys 
    14     logging.warning("Error while determining build number\n  %s" % sys.exc_value) 
     17except subprocess.CalledProcessError as cpe: 
     18    logging.warning("Error while determining build number\n  Using command:\n %s \n Output:\n %s"% (cpe.cmd,cpe.output)) 
  • src/sas/sascalc/dataloader/readers/cansas_reader.py

    r5f26aa4 r654e8e0  
    6262    type_name = "canSAS" 
    6363    invalid = True 
     64    frm = "" 
    6465    ## Log messages and errors 
    6566    logging = None 
     
    138139                    for entry in entry_list: 
    139140                        # Create a new DataInfo object for every <SASentry> 
    140  
    141141 
    142142                        # Set the file name and then parse the entry. 
     
    183183        return self.output 
    184184 
    185     def _parse_entry(self, dom): 
     185    def _parse_entry(self, dom, recurse=False): 
    186186        """ 
    187187        Parse a SASEntry - new recursive method for parsing the dom of 
     
    192192        """ 
    193193 
    194         frm = inspect.stack()[1] 
    195         if not self._is_call_local(frm): 
     194        if not self._is_call_local() and not recurse: 
    196195            self.reset_state() 
    197196            self.add_data_set() 
     
    201200        self.base_ns = "{0}{1}{2}".format("{", \ 
    202201                            CANSAS_NS.get(self.cansas_version).get("ns"), "}") 
    203         tagname = '' 
    204         tagname_original = '' 
    205202 
    206203        # Go through each child in the parent element 
     
    225222                    self._initialize_new_data_set() 
    226223                ## Recursion step to access data within the group 
    227                 self._parse_entry(node) 
     224                self._parse_entry(node, True) 
    228225                if tagname == "SASsample": 
    229226                    self.current_datainfo.sample.name = name 
     
    437434                length = len(self.names) - 1 
    438435            self.parent_class = self.names[length] 
    439         if not self._is_call_local(frm): 
     436        if not self._is_call_local() and not recurse: 
     437            self.frm = "" 
    440438            self.add_data_set() 
    441439            empty = None 
     
    448446 
    449447 
    450     def _is_call_local(self, frm=""): 
    451         """ 
    452  
    453         :return: 
    454         """ 
    455         if frm == "": 
    456             frm = inspect.stack()[1] 
    457         mod_name = frm[1].replace("\\", "/").replace(".pyc", "") 
     448    def _is_call_local(self): 
     449        """ 
     450 
     451        """ 
     452        if self.frm == "": 
     453            inter = inspect.stack() 
     454            self.frm = inter[2] 
     455        mod_name = self.frm[1].replace("\\", "/").replace(".pyc", "") 
    458456        mod_name = mod_name.replace(".py", "") 
    459457        mod = mod_name.split("sas/") 
     
    836834        # If the calling function was not the cansas reader, return a minidom 
    837835        #      object rather than an lxml object. 
    838         frm = inspect.stack()[1] 
    839         doc, entry_node = self._check_origin(entry_node, doc, frm) 
     836        self.frm = inspect.stack()[1] 
     837        doc, entry_node = self._check_origin(entry_node, doc) 
    840838        return doc, entry_node 
    841839 
     
    12321230                self.append(node, entry_node) 
    12331231 
    1234     def _check_origin(self, entry_node, doc, frm): 
     1232    def _check_origin(self, entry_node, doc): 
    12351233        """ 
    12361234        Return the document, and the SASentry node associated with 
     
    12421240        :param doc: entire xml tree 
    12431241        """ 
    1244         if not frm: 
    1245             frm = inspect.stack()[1] 
    1246         mod_name = frm[1].replace("\\", "/").replace(".pyc", "") 
     1242        if not self.frm: 
     1243            self.frm = inspect.stack()[1] 
     1244        mod_name = self.frm[1].replace("\\", "/").replace(".pyc", "") 
    12471245        mod_name = mod_name.replace(".py", "") 
    12481246        mod = mod_name.split("sas/") 
  • src/sas/sasgui/guiframe/media/graph_help.rst

    re68c9bf rf9b0c81  
    4242plot window. 
    4343 
    44 *NOTE! If a residuals graph (when fitting data) is hidden, it will not show up 
    45 after computation.* 
     44.. note::  
     45    *If a residuals graph (when fitting data) is hidden, it will not show up 
     46    after computation.* 
    4647 
    4748Dragging a plot 
     
    6768After zooming in on a a region, the *left arrow* or *right arrow* buttons on 
    6869the toolbar will switch between recent views. 
     70 
     71The axis range can also be specified manually.  To do so go to the *Graph Menu* 
     72(see Invoking_the_graph_menu_ for further details), choose the *Set Graph Range* 
     73option and enter the limits in the pop box. 
    6974 
    7075*NOTE! If a wheel mouse is available scrolling the wheel will zoom in/out 
     
    116121^^^^^^^^^^^^^^^^^^^ 
    117122 
    118 From the *Graph Menu* (see Invoking_the_graph_menu_) it is also possible to 
    119 make some custom modifications to plots, including: 
     123It is possible to make custom modifications to plots including: 
    120124 
    121125*  changing the plot window title 
    122 *  changing the axis legend locations 
    123 *  changing the axis legend label text 
    124 *  changing the axis legend label units 
    125 *  changing the axis legend label font & font colour 
     126*  changing the default legend location and toggling it on/off 
     127*  changing the axis label text 
     128*  changing the axis label units 
     129*  changing the axis label font & font colour 
    126130*  adding/removing a text string 
    127131*  adding a grid overlay 
     132 
     133The legend and text strings can be drag and dropped around the plot 
     134 
     135These options are accessed through the *Graph Menu* (see Invoking_the_graph_menu_) 
     136and selecting *Modify Graph Appearance* (for axis labels, grid overlay and 
     137legend position) or *Add Text* to add textual annotations, selecting font, color, 
     138style and size. *Remove Text* will remove the last annotation added. To change 
     139the legend. *Window Title* allows a custom title to be entered instead of Graph 
     140x.  
    128141 
    129142Changing scales 
     
    234247selected data will be removed from the plot. 
    235248 
    236 *NOTE! This action cannot be undone.* 
     249.. note:: 
     250    The Remove data set action cannot be undone. 
    237251 
    238252Show-Hide error bars 
     
    248262In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Modify Plot 
    249263Property* to change the size, color, or shape of the displayed marker for the 
    250 chosen dataset, or to change the dataset label that appears on the plot. 
     264chosen dataset, or to change the dataset label that appears in the plot legend 
     265box. 
    251266 
    252267.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    292307average. 
    293308 
    294 *NOTE! The displayed average only updates when input focus is moved back to 
    295 that window; ie, when the mouse pointer is moved onto that plot.* 
     309.. note:: 
     310    The displayed average only updates when input focus is moved back to 
     311    that window; ie, when the mouse pointer is moved onto that plot. 
    296312 
    297313Selecting *Box Sum* automatically brings up the 'Slicer Parameters' dialog in 
     
    359375.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    360376 
    361 .. note::  This help document was last changed by Steve King, 01May2015 
     377.. note::  This help document was last modified by Paul Butler, 05 September, 2016 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    r7673ecd r654e8e0  
    15691569                    if output[ind].run_name is not None\ 
    15701570                        and len(output[ind].run_name) != 0: 
    1571                         name = output[ind].run_name 
     1571                        if isinstance(output[ind].run_name, dict): 
     1572                            name = output[ind].run_name.keys()[0] 
     1573                        else: 
     1574                            name = output[ind].run_name 
    15721575                    else: 
    15731576                        name = original_fname 
  • src/sas/sasgui/perspectives/invariant/invariant_panel.py

    rcb93b40 r654e8e0  
    830830        """ 
    831831        try: 
    832             attr = getattr(self, key) 
     832            if key in ['compute_num', 'file', 'is_time_machine', 'state_num']: 
     833                return 
     834            else: 
     835                attr = getattr(self, key) 
    833836            if attr.__class__.__name__ == "StaticText": 
    834837                return 
    835             if type(value) is not bool: 
     838            if value in ["True", "False", True, False]: 
     839                value = bool(value) 
     840            else: 
    836841                value = str(value) 
    837842            attr.SetValue(value) 
  • src/sas/sasgui/perspectives/pr/media/pr_help.rst

    rb64b87c r0391dae  
    1515*P(r)* is set to be equal to an expansion of base functions of the type 
    1616 
    17   |bigphi|\_n(r) = 2.r.sin(|pi|\ .n.r/D_max) 
     17.. math:: 
     18  \Phi_{n(r)} = 2 r sin(\frac{\pi n r}{D_{max}}) 
    1819 
    19 The coefficient of each base function in the expansion is found by performing  
     20The coefficient of each base function in the expansion is found by performing 
    2021a least square fit with the following fit function 
    2122 
    22   |chi|\ :sup:`2` = |bigsigma|\ :sub:`i` [ I\ :sub:`meas`\ (Q\ :sub:`i`\ ) - I\ :sub:`th`\ (Q\ :sub:`i`\ ) ] :sup:`2` / (Error) :sup:`2` + Reg_term 
     23.. math:: 
    2324 
    24 where I\ :sub:`meas`\ (Q) is the measured scattering intensity and  
    25 I\ :sub:`th`\ (Q) is the prediction from the Fourier transform of the *P(r)*  
    26 expansion.  
     25  \chi^2=\frac{\sum_i (I_{meas}(Q_i)-I_{th}(Q_i))^2}{error^2}+Reg\_term 
     26   
    2727 
    28 The *Reg_term* term is a regularization term set to the second derivative  
    29 d\ :sup:`2`\ *P(r)* / dr\ :sup:`2` integrated over *r*. It is used to produce a  
    30 smooth *P(r)* output. 
     28where $I_{meas}(Q_i)$ is the measured scattering intensity and $I_{th}(Q_i)$ is 
     29the prediction from the Fourier transform of the *P(r)* expansion.  
     30 
     31The $Reg\_term$ term is a regularization term set to the second derivative  
     32$d^2P(r)/d^2r$ integrated over $r$. It is used to produce a smooth *P(r)* output. 
    3133 
    3234.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
     
    4547   system. 
    4648 
     49P(r) inversion requires that the background be perfectly subtracted.  This is 
     50often difficult to do well and thus many data sets will include a background. 
     51For those cases, the user should check the "estimate background" box and the 
     52module will do its best to estimate it. 
     53 
     54The P(r) module is constantly computing in the background what the optimum 
     55*number of terms* should be as well as the optimum *regularization constant*. 
     56These are constantly updated in the buttons next to the entry boxes on the GUI. 
     57These are almost always close and unless the user has a good reason to choose 
     58differently they should just click on the buttons to accept both.  {D_max} must 
     59still be set by the user.  However, besides looking at the output, the user can 
     60click the explore button which will bring up a graph of chi^2 vs Dmax over a 
     61range around the current Dmax.  The user can change the range and the number of 
     62points to explore in that range.  They can also choose to plot several other 
     63parameters as a function of Dmax including: I0, Rg, Oscillation parameter, 
     64background, positive fraction, and 1-sigma positive fraction. 
     65 
    4766.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    4867 
     
    5574.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ 
    5675 
    57 .. note::  This help document was last changed by Steve King, 01May2015 
     76.. note::  This help document was last modified by Paul Butler, 05 September, 2016 
  • src/sas/sasgui/perspectives/fitting/models.py

    r6fb559d rdceff6e  
    151151    try: 
    152152        import compileall 
    153         compileall.compile_dir(dir=dir, ddir=dir, force=1, 
     153        compileall.compile_dir(dir=dir, ddir=dir, force=0, 
    154154                               quiet=report_problem) 
    155155    except: 
Note: See TracChangeset for help on using the changeset viewer.