Changeset 788d4c3 in sasview


Ignore:
Timestamp:
Mar 2, 2015 1:25:50 PM (9 years ago)
Author:
Doucet, Mathieu <doucetm@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
c43e875
Parents:
26d2d88
Message:

Fix pylint issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/dataloader/readers/cansas_constants.py

    r79492222 r788d4c3  
    33the cansas_reader.py file to read in any version of the cansas format. 
    44""" 
    5 class CansasConstants: 
     5class CansasConstants(object): 
    66    """ 
    77    The base class to define where all of the data is to be saved by 
    88    cansas_reader.py. 
    99    """ 
    10      
    1110    names = '' 
    1211    format = '' 
    13      
    14      
     12 
    1513    def __init__(self): 
    1614        self.names = self.CANSAS_NS 
    1715        self.format = self.CANSAS_FORMAT 
    18      
    19      
     16 
    2017    def iterate_namespace(self, namespace): 
    2118        """ 
    2219        Method to iterate through a cansas constants tree based on a list of 
    2320        names 
    24          
     21 
    2522        :param namespace: A list of names that match the tree structure of 
    2623            cansas_constants 
     
    4643                             return_me.current_level.get("units_required", "") 
    4744                    # Where are how to store the variable for the given 
    48                     # namespace CANSAS_CONSTANTS tree is hierarchical, so  
     45                    # namespace CANSAS_CONSTANTS tree is hierarchical, so 
    4946                    # is no value, inherit 
    5047                    return_me.ns_variable = cl_variable if cl_variable != "" \ 
     
    5956                return_me.ns_datatype = "content" 
    6057                return_me.ns_optional = True 
    61         return return_me     
    62      
    63      
     58        return return_me 
     59 
    6460    def get_namespace_map(self): 
    6561        """ 
     
    6763        """ 
    6864        return self.names 
    69      
    70      
     65 
    7166    # CANSAS_NS holds the base namespace and default schema file information 
    72     CANSAS_NS = { 
    73                  "1.0" :  
    74                  { 
    75                   "ns" : "cansas1d/1.0",  
    76                   "schema" : "cansas1d_v1_0.xsd" 
    77                   }, 
    78                  "1.1" :  
    79                  { 
    80                   "ns" : "urn:cansas1d:1.1",  
    81                   "schema" : "cansas1d_v1_1.xsd" 
    82                   } 
     67    CANSAS_NS = {"1.0" : { 
     68                         "ns" : "cansas1d/1.0", 
     69                         "schema" : "cansas1d_v1_0.xsd" 
     70                         }, 
     71                 "1.1" : { 
     72                         "ns" : "urn:cansas1d:1.1", 
     73                         "schema" : "cansas1d_v1_1.xsd" 
     74                         } 
    8375                 } 
    84      
    85      
     76 
    8677    # The constants below hold information on where to store the CanSAS data 
    8778    # when loaded in using sasview 
     
    9384    TITLE = {"variable" : "{0}.title = \"{1}\""} 
    9485    SASNOTE = {"variable" : "{0}.notes.append(\'{1}\')"} 
    95     SASPROCESS_TERM = { 
    96                        "variable" : None, 
    97                        "attributes" :  
    98                        { 
    99                         "unit" : {"variable" : None}, 
    100                         "name" : {"variable" : None} 
    101                         } 
    102                        } 
    103     SASPROCESS_SASPROCESSNOTE = { 
    104                                  "variable" : None, 
     86    SASPROCESS_TERM = {"variable" : None, 
     87                       "attributes" : { 
     88                                       "unit" : {"variable" : None}, 
     89                                       "name" : {"variable" : None} 
     90                                       } 
     91                       } 
     92    SASPROCESS_SASPROCESSNOTE = {"variable" : None, 
    10593                                 "children" : {"<any>" : ANY} 
    10694                                 } 
    107     SASPROCESS = { 
    108                   "variable" : None, 
    109                   "children" : { 
    110                                 "name" : {"variable" : "{0}.name = \'{1}\'"}, 
    111                                "date" : {"variable" : "{0}.date = \'{1}\'"}, 
    112                                "description" :  
    113                                {"variable" : "{0}.description = \'{1}\'"}, 
    114                                "term" : SASPROCESS_TERM, 
    115                                "SASprocessnote" : SASPROCESS_SASPROCESSNOTE, 
    116                                "<any>" : ANY 
    117                                }, 
    118                  } 
    119     RUN = { 
    120            "variable" : "{0}.run.append(\"{1}\")", 
    121            "attributes" :  
    122            {"name" : {"variable" : "{0}.run_name[node_value] = \"{1}\""}} 
     95    SASPROCESS = {"variable" : None, 
     96                  "children" : {"name" : {"variable" : "{0}.name = \'{1}\'"}, 
     97                                "date" : {"variable" : "{0}.date = \'{1}\'"}, 
     98                                "description" : {"variable" : "{0}.description = \'{1}\'"}, 
     99                                "term" : SASPROCESS_TERM, 
     100                                "SASprocessnote" : SASPROCESS_SASPROCESSNOTE, 
     101                                "<any>" : ANY 
     102                                }, 
     103                  } 
     104    RUN = {"variable" : "{0}.run.append(\"{1}\")", 
     105           "attributes" : {"name" : {"variable" : "{0}.run_name[node_value] = \"{1}\""}} 
    123106           } 
    124     SASDATA_IDATA_Q = { 
    125                        "variable" : "{0}.x = numpy.append({0}.x, {1})", 
     107    SASDATA_IDATA_Q = {"variable" : "{0}.x = numpy.append({0}.x, {1})", 
    126108                       "unit" : "x_unit", 
    127                        "attributes" :  
    128                        { 
    129                         "unit" :  
    130                         { 
    131                          "variable" : "{0}._xunit = \"{1}\"", 
    132                          "storeas" : "content" 
    133                          } 
    134                         }, 
    135                        } 
    136     SASDATA_IDATA_I = { 
    137                        "variable" : "{0}.y = numpy.append({0}.y, {1})", 
     109                       "attributes" : {"unit" : { 
     110                                                 "variable" : "{0}._xunit = \"{1}\"", 
     111                                                 "storeas" : "content" 
     112                                                 } 
     113                                       }, 
     114                       } 
     115    SASDATA_IDATA_I = {"variable" : "{0}.y = numpy.append({0}.y, {1})", 
    138116                       "unit" : "y_unit", 
    139                        "attributes" :  
    140                        { 
    141                         "unit" :  
    142                         { 
    143                          "variable" : "{0}._yunit = \"{1}\"", 
    144                          "storeas" : "content" 
    145                          } 
    146                         }, 
    147                        } 
    148     SASDATA_IDATA_IDEV = { 
    149                           "variable" : "{0}.dy = numpy.append({0}.dy, {1})", 
     117                       "attributes" : {"unit" : { 
     118                                                 "variable" : "{0}._yunit = \"{1}\"", 
     119                                                 "storeas" : "content" 
     120                                                 } 
     121                                       }, 
     122                       } 
     123    SASDATA_IDATA_IDEV = {"variable" : "{0}.dy = numpy.append({0}.dy, {1})", 
    150124                          "unit" : "y_unit", 
    151                           "attributes" :  
    152                           { 
    153                            "unit" :  
    154                            { 
    155                             "variable" : META_DATA, 
    156                             "storeas" : "content" 
    157                             } 
    158                            }, 
    159                           } 
    160     SASDATA_IDATA_QDEV = { 
    161                           "variable" : "{0}.dx = numpy.append({0}.dx, {1})", 
     125                          "attributes" : {"unit" : { 
     126                                                    "variable" : META_DATA, 
     127                                                    "storeas" : "content" 
     128                                                    } 
     129                                          }, 
     130                          } 
     131    SASDATA_IDATA_QDEV = {"variable" : "{0}.dx = numpy.append({0}.dx, {1})", 
    162132                          "unit" : "x_unit", 
    163                           "attributes" :  
    164                           { 
    165                            "unit" :  
    166                            { 
    167                             "variable" : META_DATA, 
    168                             "storeas" : "content" 
    169                             } 
    170                            }, 
     133                          "attributes" : {"unit" : { 
     134                                                    "variable" : META_DATA, 
     135                                                    "storeas" : "content" 
     136                                                    } 
     137                                          }, 
    171138                          } 
    172139    SASDATA_IDATA_DQL = { 
Note: See TracChangeset for help on using the changeset viewer.