Changeset 82d88d5 in sasview for src/sas/sasgui/perspectives/corfunc


Ignore:
Timestamp:
Mar 6, 2019 4:18:09 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
Children:
f923967
Parents:
cb64d86 (diff), f205d3a (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' into py37-sasgui

Location:
src/sas/sasgui/perspectives/corfunc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc_panel.py

    r5251ec6 r82d88d5  
    277277        self._transformed_data = transforms 
    278278        (transform1, transform3, idf) = transforms 
    279         plot_x = transform1.x[transform1.x <= 200] 
    280         plot_y = transform1.y[transform1.x <= 200] 
     279        plot_x = transform1.x[transform1.x <= 1000] 
     280        plot_y = transform1.y[transform1.x <= 1000] 
    281281        self._manager.show_data(Data1D(plot_x, plot_y), TRANSFORM_LABEL1) 
    282         # No need to shorten gamma3 as it's only calculated up to x=200 
     282        # No need to shorten gamma3 as it's only calculated up to x=1000 
    283283        self._manager.show_data(transform3, TRANSFORM_LABEL3) 
    284284 
    285         plot_x = idf.x[idf.x <= 200] 
    286         plot_y = idf.y[idf.x <= 200] 
     285        plot_x = idf.x[idf.x <= 1000] 
     286        plot_y = idf.y[idf.x <= 1000] 
    287287        self._manager.show_data(Data1D(plot_x, plot_y), IDF_LABEL) 
    288288 
  • src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst

    r490f790 r4d06668  
    3030of the profile provides measures of the layer thickness, and the area under  
    3131the profile is related to the amount of material that is adsorbed. 
     32 
     33.. note:: 
     34    These transforms assume that the data has been measured on a pinhole- 
     35    collimated instrument or, if not, that the data has been Lorentz- 
     36    corrected beforehand. 
    3237 
    3338Both analyses are performed in 3 stages: 
  • src/sas/sasgui/perspectives/corfunc/__init__.py

    rc23f303 r5251ec6  
    11PLUGIN_ID = "Corfunc Plug-In 0.1" 
    2 from corfunc import * 
     2from .corfunc import * 
  • src/sas/sasgui/perspectives/corfunc/corfunc.py

    r9b90bf8 r5251ec6  
    1818from sas.sascalc.dataloader.loader import Loader 
    1919import sas.sascalc.dataloader 
    20 from plot_labels import * 
     20from .plot_labels import * 
    2121 
    2222logger = logging.getLogger(__name__) 
     
    148148                    self.data_id = data.id 
    149149                    self.corfunc_panel.set_data(data) 
    150                 except: 
    151                     msg = "Corfunc set_data: " + str(sys.exc_value) 
     150                except Exception as exc: 
     151                    msg = "Corfunc set_data: " + str(exc) 
    152152                    wx.PostEvent(self.parent, StatusEvent(status=msg, 
    153153                        info='error')) 
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r5652efc r5251ec6  
    7474        if self.outputs != {} and self.outputs is not None: 
    7575            state += "\nOutputs:\n" 
    76             for key, value in self.outputs.iteritems(): 
     76            for key, value in self.outputs.items(): 
    7777                name = output_list[key][1] 
    7878                state += "{}: {}\n".format(name, str(value)) 
     
    158158        state = new_doc.createElement("state") 
    159159        top_element.appendChild(state) 
    160         for name, value in self.saved_state.iteritems(): 
     160        for name, value in self.saved_state.items(): 
    161161            element = new_doc.createElement(name) 
    162162            element.appendChild(new_doc.createTextNode(str(value))) 
     
    181181            output = new_doc.createElement("output") 
    182182            top_element.appendChild(output) 
    183             for key, value in self.outputs.iteritems(): 
     183            for key, value in self.outputs.items(): 
    184184                element = new_doc.createElement(key) 
    185185                element.appendChild(new_doc.createTextNode(str(value))) 
     
    214214                try: 
    215215                    self.timestamp = (entry.get('epoch')) 
    216                 except: 
     216                except Exception as exc: 
    217217                    msg = ("CorfuncState.fromXML: Could not read timestamp", 
    218                         "\n{}").format(sys.exc_value) 
     218                        "\n{}").format(exc) 
    219219                    logger.error(msg) 
    220220 
     
    222222            entry = get_content('ns:state', node) 
    223223            if entry is not None: 
    224                 for item in DEFAULT_STATE.iterkeys(): 
     224                for item in DEFAULT_STATE.keys(): 
    225225                    input_field = get_content("ns:{}".format(item), entry) 
    226226                    if input_field is not None: 
     
    283283            root, ext = os.path.splitext(basename) 
    284284            if not ext.lower() in self.ext: 
    285                 raise IOError, "{} is not a supported file type".format(ext) 
     285                raise IOError("{} is not a supported file type".format(ext)) 
    286286            tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 
    287287            root = tree.getroot() 
     
    299299            # File not found 
    300300            msg = "{} is not a valid file path or doesn't exist".format(path) 
    301             raise IOError, msg 
     301            raise IOError(msg) 
    302302 
    303303        if len(output) == 0: 
     
    323323            msg = ("The CanSAS writer expects a Data1D instance. {} was " 
    324324                "provided").format(datainfo.__class__.__name__) 
    325             raise RuntimeError, msg 
     325            raise RuntimeError(msg) 
    326326        if datainfo.title is None or datainfo.title == '': 
    327327            datainfo.title = datainfo.name 
     
    358358                state = CorfuncState() 
    359359                state.fromXML(nodes[0]) 
    360         except: 
     360        except Exception as exc: 
    361361            msg = "XML document does not contain CorfuncState information\n{}" 
    362             msg.format(sys.exc_value) 
     362            msg.format(exc) 
    363363            logger.info(msg) 
    364364        return state 
Note: See TracChangeset for help on using the changeset viewer.