Changes in / [827484cf:9e11cf5] in sasview


Ignore:
Files:
1 added
22 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • build_tools/conda/bumps/meta.yaml

    rb75079b r6a72e1b  
    1 package: 
    2   name: bumps 
    3   version: !!str 0.7.5.4 
    4  
    5 source: 
    6   fn: bumps-0.7.5.4.tar.gz 
    7   url: https://pypi.python.org/packages/source/b/bumps/bumps-0.7.5.4.tar.gz 
    8   md5: a47c035fbb18afa5ca53067506a5ff1c 
    9 #  patches: 
    10    # List any patch files here 
    11    # - fix.patch 
    12  
    13 # build: 
    14   #preserve_egg_dir: True 
    15   #entry_points: 
    16     # Put any entry points (scripts to be generated automatically) here. The 
    17     # syntax is module:function.  For example 
    18     # 
    19     # - bumps = bumps:main 
    20     # 
    21     # Would create an entry point called bumps that calls bumps.main() 
    22  
    23  
    24   # If this is a new build for the same version, increment the build 
    25   # number. If you do not include this key, it defaults to 0. 
    26   # number: 1 
    27  
     1about: {home: 'http://www.reflectometry.org/danse/software.html', license: UNKNOWN, 
     2  summary: Data fitting with bayesian uncertainty analysis} 
     3package: {name: bumps, version: 0.7.5.3} 
    284requirements: 
    295  build: 
     
    317    - setuptools 
    328    - six 
    33  
    349  run: 
    3510    - python 
    3611    - six 
    37  
     12source: 
     13  fn: bumps-0.7.5.3.tar.gz 
     14  md5: f17b41412c3c8ad6432a42e42cb926d5 
     15  url: https://pypi.python.org/packages/source/b/bumps/bumps-0.7.5.3.tar.gz 
    3816test: 
    39   # Python imports 
    4017  imports: 
    4118    - bumps 
     
    4623    - bumps.mystic.examples 
    4724    - bumps.mystic.optimizer 
    48  
    49   #commands: 
    50     # You can put test commands to be run here.  Use this to test that the 
    51     # entry points work. 
    52  
    53  
    54   # You can also put a file called run_test.py in the recipe that will be run 
    55   # at test time. 
    56  
    5725  requires: 
    58    - numpy 
    59    - scipy 
    60    - matplotlib 
    61  
    62 about: 
    63   home: http://www.reflectometry.org/danse/software.html 
    64   license: UNKNOWN 
    65   summary: 'Data fitting with bayesian uncertainty analysis' 
    66  
    67 # See 
    68 # http://docs.continuum.io/conda/build.html for 
    69 # more information about meta.yaml 
     26    - numpy 
     27    - scipy 
     28    - matplotlib 
  • build_tools/conda/periodictable/meta.yaml

    r55bde35 r6a72e1b  
    1 package: 
    2   name: periodictable 
    3   version: !!str 1.4.1 
    4  
    5 source: 
    6   fn: periodictable-1.4.1.tar.gz 
    7   url: https://pypi.python.org/packages/source/p/periodictable/periodictable-1.4.1.tar.gz 
    8   md5: 7246b63cc0b6b1be6e86b6616f9e866e 
    9 #  patches: 
    10    # List any patch files here 
    11    # - fix.patch 
    12  
    13 # build: 
    14   #preserve_egg_dir: True 
    15   #entry_points: 
    16     # Put any entry points (scripts to be generated automatically) here. The 
    17     # syntax is module:function.  For example 
    18     # 
    19     # - periodictable = periodictable:main 
    20     # 
    21     # Would create an entry point called periodictable that calls periodictable.main() 
    22  
    23  
    24   # If this is a new build for the same version, increment the build 
    25   # number. If you do not include this key, it defaults to 0. 
    26   # number: 1 
    27  
     1about: {home: 'http://www.reflectometry.org/danse/elements.html', license: public 
     2    domain, summary: Extensible periodic table of the elements} 
     3package: {name: periodictable, version: 1.4.1} 
    284requirements: 
    295  build: 
     
    328    - pyparsing 
    339    - numpy 
    34  
    3510  run: 
    3611    - python 
    3712    - pyparsing 
    3813    - numpy 
    39  
     14source: 
     15  fn: periodictable-1.4.1.tar.gz 
     16  md5: 7246b63cc0b6b1be6e86b6616f9e866e 
     17  url: https://pypi.python.org/packages/source/p/periodictable/periodictable-1.4.1.tar.gz 
    4018test: 
    41   # Python imports 
    4219  imports: 
    4320    - periodictable 
    44  
    45   #commands: 
    46     # You can put test commands to be run here.  Use this to test that the 
    47     # entry points work. 
    48  
    49  
    50   # You can also put a file called run_test.py in the recipe that will be run 
    51   # at test time. 
    52  
    53   # requires: 
    54     # Put any additional test requirements here.  For example 
    55     # - nose 
    56  
    57 about: 
    58   home: http://www.reflectometry.org/danse/elements.html 
    59   license: public domain 
    60   summary: 'Extensible periodic table of the elements' 
    61  
    62 # See 
    63 # http://docs.continuum.io/conda/build.html for 
    64 # more information about meta.yaml 
  • build_tools/conda/unittest-xml-reporting/meta.yaml

    r55bde35 r9701348  
    1 package: 
    2   name: unittest-xml-reporting 
    3   version: !!str 1.10.0 
    4  
    5 source: 
    6   fn: unittest-xml-reporting-1.10.0.tar.gz 
    7   url: https://pypi.python.org/packages/source/u/unittest-xml-reporting/unittest-xml-reporting-1.10.0.tar.gz 
    8   md5: f0d04be2b9bff5b744677b576c326620 
    9 #  patches: 
    10    # List any patch files here 
    11    # - fix.patch 
    12  
    13 # build: 
    14   #preserve_egg_dir: True 
    15   #entry_points: 
    16     # Put any entry points (scripts to be generated automatically) here. The 
    17     # syntax is module:function.  For example 
    18     # 
    19     # - unittest-xml-reporting = unittest-xml-reporting:main 
    20     # 
    21     # Would create an entry point called unittest-xml-reporting that calls unittest-xml-reporting.main() 
    22  
    23  
    24   # If this is a new build for the same version, increment the build 
    25   # number. If you do not include this key, it defaults to 0. 
    26   # number: 1 
    27  
     1about: {home: 'http://github.com/xmlrunner/unittest-xml-reporting/tree/master/', license: BSD 
     2    License, summary: unittest-based test runner with Ant/JUnit like XML reporting.} 
     3build: 
     4  features: 
     5    - I dunno.  The ability to actually work would be nice feature of this recipe. 
     6package: {name: unittest-xml-reporting, version: 1.10.0} 
    287requirements: 
    298  build: 
    309    - python 
    3110    - setuptools 
    32     - six >=1.4.0 
    33  
     11    - six 
    3412  run: 
    3513    - python 
    36     - six >=1.4.0 
    37  
     14    - six 
     15source: 
     16  fn: unittest-xml-reporting-1.10.0.tar.gz 
     17  md5: f0d04be2b9bff5b744677b576c326620 
     18  url: https://pypi.python.org/packages/source/u/unittest-xml-reporting/unittest-xml-reporting-1.10.0.tar.gz 
    3819test: 
    39   # Python imports 
    4020  imports: 
    4121    - xmlrunner 
    4222    - xmlrunner.extra 
    4323    - xmlrunner.tests 
    44  
    45   #commands: 
    46     # You can put test commands to be run here.  Use this to test that the 
    47     # entry points work. 
    48  
    49  
    50   # You can also put a file called run_test.py in the recipe that will be run 
    51   # at test time. 
    52  
    53   # requires: 
    54     # Put any additional test requirements here.  For example 
    55     # - nose 
    56  
    57 about: 
    58   home: http://github.com/xmlrunner/unittest-xml-reporting/tree/master/ 
    59   license:  BSD License 
    60   summary: 'unittest-based test runner with Ant/JUnit like XML reporting.' 
    61  
    62 # See 
    63 # http://docs.continuum.io/conda/build.html for 
    64 # more information about meta.yaml 
  • docs/sphinx-docs/build_sphinx.py

    r30d7fb5 rf620870  
    108108    build() 
    109109         
    110     print "=== Done ===" 
     110print "=== Done ===" 
  • sasview/setup_exe.py

    r4172557 r3a39c2e  
    307307# 
    308308packages = [ 
    309     'matplotlib', 'scipy', 'encodings', 'comtypes', 
     309    'matplotlib', 'scipy', 'pytz', 'encodings', 'comtypes', 
    310310    'win32com', 'ho.pisa', 'bumps', 
    311311    ] 
     
    326326 
    327327# Exclude packages that are not needed but are often found on build systems 
    328 excludes = ['Tkinter', 'PyQt4', '_ssl', '_tkagg', 'sip', 'pytz'] 
     328excludes = ['Tkinter', 'PyQt4', '_ssl', '_tkagg', 'sip'] 
    329329 
    330330 
  • src/sas/data_util/nxsunit.py

    rb3efb7d r79492222  
    128128    temperature = _build_metric_units('kelvin','K') 
    129129    temperature.update(_build_metric_units('Kelvin','K')) 
    130     temperature.update(_build_metric_units('Celcius', 'C')) 
    131     temperature.update(_build_metric_units('celcius', 'C')) 
    132      
     130 
    133131    charge = _build_metric_units('coulomb','C') 
    134132    charge.update({'microAmp*hour':0.0036}) 
     
    148146    """ 
    149147    Unit converter for NeXus style units. 
     148 
    150149    """ 
    151150    # Define the units, using both American and European spelling. 
  • src/sas/dataloader/data_info.py

    rb3efb7d r79492222  
    338338    ## Transmission [float] [fraction] 
    339339    transmission = None 
    340     ## Temperature [float] [No Default] 
     340    ## Temperature [float] [C] 
    341341    temperature = None 
    342     temperature_unit = None 
     342    temperature_unit = 'C' 
    343343    ## Position [Vector] [mm] 
    344344    position = None 
  • src/sas/dataloader/readers/cansas_reader.py

    rb3efb7d r79492222  
    307307        if 'unit' in attr and new_current_level.get('unit') is not None: 
    308308            try: 
    309                 local_unit = attr['unit'] 
    310309                if isinstance(node_value, float) is False: 
    311310                    exec("node_value = float({0})".format(node_value)) 
     
    313312                unitname = new_current_level.get("unit") 
    314313                exec "default_unit = data1d.{0}".format(unitname) 
    315                 if local_unit is not None and default_unit is not None and \ 
    316                         local_unit.lower() != default_unit.lower() \ 
    317                         and local_unit.lower() != "none": 
     314                local_unit = attr['unit'] 
     315                if local_unit.lower() != default_unit.lower() and \ 
     316                    local_unit is not None and local_unit.lower() != "none" \ 
     317                        and default_unit is not None: 
    318318                    if HAS_CONVERTER == True: 
    319                         ## Check local units - bad units raise KeyError 
    320                         data_conv_q = Converter(local_unit) 
    321                         value_unit = default_unit 
    322                         i_string = "node_value = data_conv_q" 
    323                         i_string += "(node_value, units=data1d.{0})" 
    324                         exec i_string.format(unitname) 
     319                        try: 
     320                            ## Check local units - bad units raise KeyError 
     321                            Converter(local_unit) 
     322                            data_conv_q = Converter(attr['unit']) 
     323                            value_unit = default_unit 
     324                            i_string = "node_value = data_conv_q" 
     325                            i_string += "(node_value, units=data1d.{0})" 
     326                            exec i_string.format(unitname) 
     327                        except KeyError: 
     328                            err_msg = "CanSAS reader: could not convert " 
     329                            err_msg += "{0} unit {1}; " 
     330                            err_msg = err_msg.format(tagname, local_unit) 
     331                            intermediate = "err_msg += " + \ 
     332                                        "\"expecting [{1}]  {2}\"" + \ 
     333                                        ".format(data1d.{0}, " + \ 
     334                                        "sys.exc_info()[1])" 
     335                            exec intermediate.format(unitname, "{0}", "{1}") 
     336                            self.errors.append(err_msg) 
     337                            raise ValueError(err_msg) 
     338                        except: 
     339                            err_msg = \ 
     340                                "CanSAS reader: could not convert the units" 
     341                            self.errors.append(err_msg) 
     342                            return 
    325343                    else: 
    326344                        value_unit = local_unit 
    327                         err_msg = "Unit converter is not available.\n" 
     345                        err_msg = "CanSAS reader: unrecognized %s unit [%s];"\ 
     346                        % (node_value, default_unit) 
     347                        err_msg += " expecting [%s]" % local_unit 
    328348                        self.errors.append(err_msg) 
     349                        raise ValueError, err_msg 
    329350                else: 
    330351                    value_unit = local_unit 
    331             except KeyError: 
    332                 err_msg = "CanSAS reader: unexpected " 
    333                 err_msg += "\"{0}\" unit [{1}]; " 
    334                 err_msg = err_msg.format(tagname, local_unit) 
    335                 intermediate = "err_msg += " + \ 
    336                             "\"expecting [{1}]\"" + \ 
    337                             ".format(data1d.{0})" 
    338                 exec intermediate.format(unitname, "{0}", "{1}") 
     352            except: 
     353                err_msg = "CanSAS reader: could not convert " 
     354                err_msg += "Q unit [%s]; " % attr['unit'] 
     355                intermediate = "err_msg += \"expecting [%s]\n  %s\" % " + \ 
     356                            "(data1d.{0}, sys.exc_info()[1])" 
     357                exec intermediate.format(unitname) 
    339358                self.errors.append(err_msg) 
    340                 value_unit = local_unit 
    341             except: 
    342                 print sys.exc_info() 
    343                 err_msg = "CanSAS reader: unknown error converting " 
    344                 err_msg += "\"{0}\" unit [{1}]" 
    345                 err_msg = err_msg.format(tagname, local_unit) 
    346                 self.errors.append(err_msg) 
    347                 value_unit = local_unit 
     359                raise ValueError, err_msg 
    348360        elif 'unit' in attr: 
    349361            value_unit = attr['unit'] 
     
    476488                                                        data1d, tagname) 
    477489                    cansas_attrib = \ 
    478                         cs_values.current_level.get("attributes").get(key) 
     490                    cs_values.current_level.get("attributes").get(key) 
    479491                    attrib_variable = cansas_attrib.get("variable") 
    480492                    if key == 'unit' and unit != '': 
  • src/sas/guiframe/gui_manager.py

    r9bbb627 rb9a5f0e  
    2424import logging 
    2525import httplib 
    26 import webbrowser 
    27  
    2826 
    2927from sas.guiframe.events import EVT_CATEGORY 
     
    13271325    def _add_help_menu(self): 
    13281326        """ 
    1329         add help menu to menu bar.  Includes welcome page, about page, 
    1330         tutorial PDF and documentation pages.  
     1327        add help menu 
    13311328        """ 
    13321329        # Help menu 
     
    13391336                id = wx.NewId() 
    13401337                self._help_menu.Append(id, '&Welcome', '') 
     1338                self._help_menu.AppendSeparator() 
    13411339                wx.EVT_MENU(self, id, self.show_welcome_panel) 
    13421340 
    1343         self._help_menu.AppendSeparator() 
    1344         id = wx.NewId() 
    1345         self._help_menu.Append(id, '&Documentation', '') 
    1346         wx.EVT_MENU(self, id, self._onSphinxDocs) 
     1341        # Look for help item in plug-ins  
     1342        for item in self.plugins: 
     1343            if hasattr(item, "help"): 
     1344                id = wx.NewId() 
     1345                self._help_menu.Append(id,'&%s Help' % item.sub_menu, '') 
     1346                wx.EVT_MENU(self, id, item.help) 
     1347 
     1348        # Only show new Sphinx docs link if version of wx supports displaying 
     1349        # it correctly. 
     1350        show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 
     1351        if show_sphinx_docs: 
     1352            self._help_menu.AppendSeparator() 
     1353            id = wx.NewId() 
     1354            self._help_menu.Append(id, '&Sphinx Documentation', '') 
     1355            wx.EVT_MENU(self, id, self._onSphinxDocs) 
    13471356 
    13481357        if config._do_tutorial and (IS_WIN or sys.platform =='darwin'): 
     
    21532162    def _onSphinxDocs(self, evt): 
    21542163        """ 
    2155         Bring up Sphinx Documentation.  If Wx 2.9 or higher is installed  
    2156         with proper HTML support then Pop up a Sphinx Documentation dialog 
    2157         locally.  If not pop up a new tab in the default system browser  
    2158         calling the documentation website. 
     2164        Pop up a Sphinx Documentation dialog. 
    21592165         
    21602166        :param evt: menu event 
     
    21622168        # Running SasView "in-place" using run.py means the docs will be in a 
    21632169        # different place than they would otherwise. 
    2164  
    2165         show_sphinx_docs = float(wx.__version__[:3]) >= 2.9 
    2166         if show_sphinx_docs: 
    2167             SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
    2168             if SPHINX_DOC_ENV in os.environ: 
    2169                 docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 
    2170             else: 
    2171                 docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 
    2172  
    2173             if os.path.exists(docs_path): 
    2174                 from documentation_window import DocumentationWindow 
    2175  
    2176                 sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 
    2177                 sphinx_doc_viewer.Show() 
    2178             else: 
    2179                 logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 
     2170        SPHINX_DOC_ENV = "SASVIEW_DOC_PATH" 
     2171        if SPHINX_DOC_ENV in os.environ: 
     2172            docs_path = os.path.join(os.environ[SPHINX_DOC_ENV], "index.html") 
    21802173        else: 
    2181             #For red hat and maybe others who do not have Wx 3.0 
    2182             #just send to webpage of documentation 
    2183             webbrowser.open_new_tab('http://www.sasview.org/sasview') 
     2174            docs_path = os.path.join(PATH_APP, "..", "..", "doc", "index.html") 
     2175 
     2176        if os.path.exists(docs_path): 
     2177            from documentation_window import DocumentationWindow 
     2178 
     2179            sphinx_doc_viewer = DocumentationWindow(None, -1, docs_path) 
     2180            sphinx_doc_viewer.Show() 
     2181        else: 
     2182            logging.error("Could not find Sphinx documentation at '%' -- has it been built?" % docs_path) 
    21842183 
    21852184    def set_manager(self, manager): 
  • src/sas/guiframe/gui_statusbar.py

    rb3efb7d r79492222  
    315315        if msg == "error": 
    316316            e_msg = "Error(s) Occurred:\n" 
    317             e_msg += "\t" + event.status + "\n\n" 
    318             e_msg += "Further information might be available in " 
    319             e_msg += "the Console log (bottom right corner)." 
     317            e_msg += event.status 
    320318            wx.MessageBox(e_msg, style=wx.ICON_ERROR) 
    321319 
  • src/sas/guiframe/local_perspectives/data_loader/data_loader.py

    rb3efb7d r7a04dbb  
    171171                                  file) for file in os.listdir(path)] 
    172172    
    173     def _process_data_and_errors(self, item, p_file, output, message): 
    174         """ 
    175         Check to see if data set loaded with any errors. If so, append to 
    176             error message to be sure user knows the issue. 
    177         """ 
    178         data_error = False 
    179         for error_data in item.errors: 
    180             data_error = True 
    181             message += "\tError: {0}\n".format(error_data) 
    182         data = self.parent.create_gui_data(item, p_file) 
    183         output[data.id] = data 
    184         return output, message, data_error 
    185     
    186173    def get_data(self, path, format=None): 
    187174        """ 
     
    191178        output = {} 
    192179        any_error = False 
    193         data_error = False 
    194180        error_message = "" 
    195181        for p_file in path: 
    196182            info = "info" 
    197183            basename  = os.path.basename(p_file) 
    198             _, extension = os.path.splitext(basename) 
     184            root, extension = os.path.splitext(basename) 
    199185            if extension.lower() in EXTENSIONS: 
    200186                any_error = True 
     
    208194         
    209195            try: 
    210                 message = "Loading Data... " + str(p_file) + "\n" 
    211                 self.load_update(output=output, message=message, info=info) 
    212196                temp =  self.loader.load(p_file, format) 
    213197                if temp.__class__.__name__ == "list": 
    214198                    for item in temp: 
    215                         output, error_message, data_error = \ 
    216                             self._process_data_and_errors(item,  
    217                                                           p_file,  
    218                                                           output,  
    219                                                           error_message) 
     199                        data = self.parent.create_gui_data(item, p_file) 
     200                        output[data.id] = data 
    220201                else: 
    221                     output, error_message, data_error = \ 
    222                             self._process_data_and_errors(temp,  
    223                                                           p_file,  
    224                                                           output,  
    225                                                           error_message) 
     202                    data = self.parent.create_gui_data(temp, p_file) 
     203                    output[data.id] = data 
     204                message = "Loading Data..." + str(p_file) + "\n" 
     205                self.load_update(output=output, message=message, info=info) 
    226206            except: 
    227207                any_error = True 
    228         if any_error or error_message != "": 
    229             if error_message == "": 
    230                 error = "Error: " + str(sys.exc_value) + "\n" 
    231                 error += "while loading Data: \n%s\n" % str(p_file) 
    232                 error_message = "The data file you selected could not be loaded.\n" 
    233                 error_message += "Make sure the content of your file" 
    234                 error_message += " is properly formatted.\n\n" 
    235                 error_message += "When contacting the DANSE team, mention the" 
    236                 error_message += " following:\n%s" % str(error) 
    237             elif data_error: 
    238                 base_message = "Errors occurred while loading {0}\n".format(p_file) 
    239                 base_message += "The data file loaded but with errors.\n" 
    240                 error_message = base_message + error_message 
    241             else: 
    242                 error_message += "%s\n"% str(p_file) 
    243             info = "error" 
    244             self.load_update(output=output, message=error_message,  
     208                if error_message == "": 
     209                     error = "Error: " + str(sys.exc_value) + "\n" 
     210                     error += "while loading Data: \n%s\n" % str(p_file) 
     211                     error_message = "The data file you selected could not be loaded.\n" 
     212                     error_message += "Make sure the content of your file" 
     213                     error_message += " is properly formatted.\n\n" 
     214                     error_message += "When contacting the DANSE team, mention the" 
     215                     error_message += " following:\n%s" % str(error) 
     216                else: 
     217                     error_message += "%s\n"% str(p_file) 
     218                info = "error" 
     219                self.load_update(output=output, message=error_message,  
    245220                                  info=info) 
    246221                 
    247         else: 
    248             message = "Loading Data Complete! " 
     222        message = "Loading Data Complete! " 
    249223        message += log_msg 
     224        if error_message != "": 
     225            info = 'error' 
    250226        self.load_complete(output=output, error_message=error_message, 
    251227                       message=message, path=path, info=info) 
  • test/sasdataloader/test/utest_abs_reader.py

    rb3efb7d r35ec279  
    345345        self.assertEqual(self.data.filename, filename) 
    346346        # The followed should not have been loaded 
    347         self.assertEqual(self.data.sample.thickness, 0.00103) 
     347        self.assertEqual(self.data.sample.thickness, None) 
    348348        # This one should 
    349349        self.assertEqual(self.data.sample.transmission, 0.327) 
    350350         
    351351        self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D") 
    352         print self.data.errors 
    353         self.assertEqual(len(self.data.errors), 2) 
     352        self.assertEqual(len(self.data.errors), 1) 
    354353         
    355354         
Note: See TracChangeset for help on using the changeset viewer.