
import numpy as np


def load_series(output_file):
    '''
    Reads a column of text containing HydroTrend output. Returns a numpy array,
    or None on an error.
    '''
    try:
        series = np.loadtxt(output_file, skiprows=2)
    except (IOError, StopIteration):
        pass
    else:
        return(series)


from subprocess import call
import numpy as np


def load(output_file):
    '''
    Reads a column of text containing HydroTrend output. Returns a numpy array,
    or None on an error.
    '''
    try:
        series = np.loadtxt(output_file, skiprows=2)
    except (IOError, StopIteration):
        pass
    else:
        return(series)


def call(input_dir, output_dir):
    '''
    Invokes HydroTrend through the shell.
    '''
    call(['hydrotrend', '--in-dir', input_dir, '--out-dir', output_dir])

Add call() function, rename load() function
Add call() function, rename load() function

Slowly encapsulating the run_hydrotrend.py script used in
the Dakota experiments.

  
+ from subprocess import call
  import numpy as np
  
  
- def load_series(output_file):
+ def load(output_file):
      '''
      Reads a column of text containing HydroTrend output. Returns a numpy array,
      or None on an error.
      '''
      try:
          series = np.loadtxt(output_file, skiprows=2)
      except (IOError, StopIteration):
          pass
      else:
          return(series)
  
+ 
+ def call(input_dir, output_dir):
+     '''
+     Invokes HydroTrend through the shell.
+     '''
+     call(['hydrotrend', '--in-dir', input_dir, '--out-dir', output_dir])
+ 
Add call() function, rename load() function
## Code Before:

import numpy as np


def load_series(output_file):
    '''
    Reads a column of text containing HydroTrend output. Returns a numpy array,
    or None on an error.
    '''
    try:
        series = np.loadtxt(output_file, skiprows=2)
    except (IOError, StopIteration):
        pass
    else:
        return(series)

## Instruction:
Add call() function, rename load() function
## Code After:

from subprocess import call
import numpy as np


def load(output_file):
    '''
    Reads a column of text containing HydroTrend output. Returns a numpy array,
    or None on an error.
    '''
    try:
        series = np.loadtxt(output_file, skiprows=2)
    except (IOError, StopIteration):
        pass
    else:
        return(series)


def call(input_dir, output_dir):
    '''
    Invokes HydroTrend through the shell.
    '''
    call(['hydrotrend', '--in-dir', input_dir, '--out-dir', output_dir])
