Ignore:
Timestamp:
Nov 15, 2017 4:33:09 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
d4881f6a
Parents:
7c487846
Message:

Initial commit of the P(r) inversion perspective.
Code merged from Jeff Krzywon's ESS_GUI_Pr branch.
Also, minor 2to3 mods to sascalc/sasgui to enble error free setup.

Location:
src/sas/sasgui/perspectives/file_converter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/file_converter/__init__.py

    • Property mode changed from 100644 to 100755
    r77d92cd rfa81e94  
    11PLUGIN_ID = "File-Converter Plug-In 1.0" 
    2 from file_converter import * 
     2from .file_converter import * 
  • src/sas/sasgui/perspectives/file_converter/converter_panel.py

    • Property mode changed from 100644 to 100755
    ra26f67f rfa81e94  
    112112            [group_path, group_name] = os.path.split(filepath) 
    113113            ext = "." + group_name.split('.')[-1] # File extension 
    114             for frame_number, frame_data in frame_data.iteritems(): 
     114            for frame_number, frame_data in frame_data.items(): 
    115115                # Append frame number to base filename 
    116116                filename = group_name.replace(ext, str(frame_number)+ext) 
     
    155155            # If lines end with comma or semi-colon, trim the last character 
    156156            if end_char == ',' or end_char == ';': 
    157                 data = map(lambda s: s[0:-1], data) 
     157                data = [s[0:-1] for s in data] 
    158158            else: 
    159159                msg = ("Error reading {}: Lines must end with a digit, comma " 
     
    275275            else: 
    276276                return { 'frames': [], 'inc': None, 'file': single_file } 
    277         frames = range(first_frame, last_frame + 1, increment) 
     277        frames = list(range(first_frame, last_frame + 1, increment)) 
    278278        return { 'frames': frames, 'inc': increment, 'file': single_file } 
    279279 
     
    335335        if single_file: 
    336336            # Only need to set metadata on first Data1D object 
    337             frame_data = frame_data.values() # Don't need to know frame numbers 
     337            frame_data = list(frame_data.values()) # Don't need to know frame numbers 
    338338            frame_data[0].filename = output_path.split('\\')[-1] 
    339             for key, value in metadata.iteritems(): 
     339            for key, value in metadata.items(): 
    340340                setattr(frame_data[0], key, value) 
    341341        else: 
    342342            # Need to set metadata for all Data1D objects 
    343             for datainfo in frame_data.values(): 
     343            for datainfo in list(frame_data.values()): 
    344344                datainfo.filename = output_path.split('\\')[-1] 
    345                 for key, value in metadata.iteritems(): 
     345                for key, value in metadata.items(): 
    346346                    setattr(datainfo, key, value) 
    347347 
     
    355355    def convert_2d_data(self, dataset): 
    356356        metadata = self.get_metadata() 
    357         for key, value in metadata.iteritems(): 
     357        for key, value in metadata.items(): 
    358358            setattr(dataset[0], key, value) 
    359359 
  • src/sas/sasgui/perspectives/file_converter/converter_widgets.py

    • Property mode changed from 100644 to 100755
    r0e11ec7 rfa81e94  
    5454        v = Vector() 
    5555        if not self.Validate(): return v 
    56         for direction, control in self._inputs.iteritems(): 
     56        for direction, control in self._inputs.items(): 
    5757            try: 
    5858                value = float(control.GetValue()) 
     
    8686        all_valid = True 
    8787        invalid_ctrl = None 
    88         for control in self._inputs.values(): 
     88        for control in list(self._inputs.values()): 
    8989            if control.GetValue() == '': continue 
    9090            control.SetBackgroundColour(wx.WHITE) 
Note: See TracChangeset for help on using the changeset viewer.