Skip to content
Snippets Groups Projects
Select Git revision
  • ef20a822b7af0f63f5d5bb2fed91b1ac85dd8c37
  • main default protected
  • Kelvinrr-patch-3
  • radius_update
  • revert-616-apollo_pan
  • vims
  • 0.10
  • Kelvinrr-patch-2
  • revert-563-minirf_fix
  • Kelvinrr-patch-1
  • 0.9
  • acpaquette-patch-3
  • acpaquette-patch-2
  • acpaquette-patch-1
  • spiceql
  • ci-coverage
  • 0.10.0
  • 0.9.1
  • 0.9.0
  • 0.8.7
  • 0.8.8
  • 0.8.6
  • 0.8.3
  • 0.8.4
  • 0.8.5
  • 0.8.2
  • 0.8.1
  • 0.8.0
  • 0.7.3
  • 0.7.2
  • 0.7.1
  • 0.7.0
  • 0.6.5
  • 0.6.4
  • 0.6.3
  • 0.6.2
36 results

change_mk_data_path.py

Blame
    • Tyler Thatcher's avatar
      ef20a822
      MEX Drivers and Tests (#297) · ef20a822
      Tyler Thatcher authored
      * First round of changes for mex test.
      
      * Updatd mex test and refactored image reading code.
      
      * Merged testing and refactored code.
      
      * First round of changes based off of comments.
      
      * Updated tests to use load function.
      
      * Updated method documentation for reading the image data.
      
      * Fixed typo and removed unused imports.
      
      * Driver for MEX and Tests for MEX Driver
      
      * Address review comments, part one - testing push to branch
      
      * Update testing re: comments and hopefully fix failing tests
      
      * Added documentation to new properties and removed isis_bytes property as it was unused.
      
      * Add parent instrument_id check
      ef20a822
      History
      MEX Drivers and Tests (#297)
      Tyler Thatcher authored
      * First round of changes for mex test.
      
      * Updatd mex test and refactored image reading code.
      
      * Merged testing and refactored code.
      
      * First round of changes based off of comments.
      
      * Updated tests to use load function.
      
      * Updated method documentation for reading the image data.
      
      * Fixed typo and removed unused imports.
      
      * Driver for MEX and Tests for MEX Driver
      
      * Address review comments, part one - testing push to branch
      
      * Update testing re: comments and hopefully fix failing tests
      
      * Added documentation to new properties and removed isis_bytes property as it was unused.
      
      * Add parent instrument_id check
    change_mk_data_path.py 938 B
    #!/usr/bin/env python
    
    import argparse
    from glob import glob
    from os import path
    import re
    
    parser = argparse.ArgumentParser()
    parser.add_argument('mk_path', action='store', help='Path containing metakernel (*.tm) files.')
    parser.add_argument('new_data_path', action='store', help='new data path containing kernel, this path will overwrite the current data path in the metakernels')
    args = parser.parse_args()
    
    mks = glob(path.join(args.mk_path,'*.[Tt][Mm]'))
    
    for mk in mks:
        with open(mk, 'r') as f:
            lines = f.readlines()
    
        lines_to_change = []
        for i,l in enumerate(lines):
            match = re.search('PATH_VALUES\s*=', l)
            if match:
                lines_to_change.append(i)
    
        if not lines_to_change:
            print(f'No path values in {mk}')
    
        for i in lines_to_change:
            lines[i] = f'      PATH_VALUES     = ( \'{args.new_data_path}\' )\n'
        with open(mk, 'w') as f:
            f.write(''.join(lines))