QuaLiKiz-Pythontools
Classes | Functions | Variables
qualikiz_tools.qualikiz_io.qualikizrun Namespace Reference

Classes

class  PathException
 Exception thrown when a path should be absolute, but it is not. More...
 
class  QuaLiKizBatch
 A collection of QuaLiKiz Runs. More...
 
class  QuaLiKizRun
 Defines everything needed for a single run of QuaLiKiz. More...
 

Functions

def equal_ignore_order (a, b)
 Use only when elements are neither hashable nor sortable! More...
 
def overwrite_dialog (path, overwrite=None)
 
def overwrite_prompt (path, overwrite=None)
 Prompt user if file/path can be overwritten. More...
 
def create_folder_prompt (path, overwrite=None)
 Overwrite folder prompt. More...
 
def run_to_netcdf (path, runmode='dimx', overwrite=None, genfromtxt=False, keepfile=True, encode=None, extra_squeeze=None, Te_var='Te', verbose=False, metareldir=QuaLiKizRun.python_debugdir)
 Convert a QuaLiKizRun to netCDF. More...
 
def qlk_from_dir (dir, batch_class=QuaLiKizBatch, run_class=QuaLiKizRun, verbose=False, prioritize_batch=True, kwargs)
 

Variables

 ROOT = ROOT[0]
 
 logger = logging.getLogger(__name__)
 
int threads_per_task = 1
 

Function Documentation

◆ create_folder_prompt()

def qualikiz_tools.qualikiz_io.qualikizrun.create_folder_prompt (   path,
  overwrite = None 
)

Overwrite folder prompt.

Parameters
overwriteIf None, prompt user. If True, overwrite and if False, throw Exception. None by default

◆ equal_ignore_order()

def qualikiz_tools.qualikiz_io.qualikizrun.equal_ignore_order (   a,
  b 
)

Use only when elements are neither hashable nor sortable!

◆ overwrite_dialog()

def qualikiz_tools.qualikiz_io.qualikizrun.overwrite_dialog (   path,
  overwrite = None 
)

◆ overwrite_prompt()

def qualikiz_tools.qualikiz_io.qualikizrun.overwrite_prompt (   path,
  overwrite = None 
)

Prompt user if file/path can be overwritten.

Parameters
overwriteIf None, prompt user. If True, overwrite and if False, throw Exception. None by default
Returns
True if user wants to overwrite

◆ qlk_from_dir()

def qualikiz_tools.qualikiz_io.qualikizrun.qlk_from_dir (   dir,
  batch_class = QuaLiKizBatch,
  run_class = QuaLiKizRun,
  verbose = False,
  prioritize_batch = True,
  kwargs 
)

◆ run_to_netcdf()

def qualikiz_tools.qualikiz_io.qualikizrun.run_to_netcdf (   path,
  runmode = 'dimx',
  overwrite = None,
  genfromtxt = False,
  keepfile = True,
  encode = None,
  extra_squeeze = None,
  Te_var = 'Te',
  verbose = False,
  metareldir = QuaLiKizRun.python_debugdir 
)

Convert a QuaLiKizRun to netCDF.

Parameters
pathPath of the run folder to netcdfize. Should contain the debug, output and output/primitive folders.
runmoderunmode of netcdfizing. If orthogonal, fold the dataset as an hyperrectangle. Any dimx will extract the values in a 1D array.
overwriteOverwrite existing netcdf file. None by default
genfromtxtUse genfromtxt instead of loadtxt. Slower and loads unreadable values as nan
keepfileKeep read ASCII files. Highy recommended!
encodeDefault encoding. This encoding will be added to all variables. Compresses (zlib) by default. See overwrite_prompt.
metareldirDirectory to metadata files. Relative to path. [default: QuaLiKizRun.python_debugdir]

Variable Documentation

◆ logger

qualikiz_tools.qualikiz_io.qualikizrun.logger = logging.getLogger(__name__)

◆ ROOT

qualikiz_tools.qualikiz_io.qualikizrun.ROOT = ROOT[0]

◆ threads_per_task

int qualikiz_tools.qualikiz_io.qualikizrun.threads_per_task = 1