diff --git a/pyVlsv/vlsvreader.py b/pyVlsv/vlsvreader.py index 64805fed..08c02554 100644 --- a/pyVlsv/vlsvreader.py +++ b/pyVlsv/vlsvreader.py @@ -1716,16 +1716,24 @@ def read_variable_to_cache(self, name, operator="pass"): # Also initialize the fileindex dict at the same go because it is very likely something you want to have for accessing cached values self.__read_fileindex_for_cellid() - def read_variable(self, name, cellids=-1,operator="pass"): + def read_variable(self, name, cellids=-1,operator="pass",sorted=False): ''' Read variables from the open vlsv file. Arguments: :param name: Name of the variable :param cellids: a value of -1 reads all data :param operator: Datareduction operator. "pass" does no operation on data + :param sorted: Return values sorted by CellID (default: file order for vg, 3D array for fsgrid) :returns: numpy array with the data .. seealso:: :func:`read` :func:`read_variable_info` ''' + + import inspect + + stck = inspect.stack() + if(inspect.getmodule(stck[1][0]) is None or (inspect.getmodule(stck[1][0]) is not None and inspect.getmodule(stck[1][0]).__name__ == '__main__')): + warnings.warn("Calling read_variable returns data in file layout order. Remember to argsort with CellID or consider using read_variable_info instead!") + cellids = get_data(cellids) # Wrapper, check if requesting an fsgrid variable diff --git a/pytools.py b/pytools.py index 8244b2b1..37302e57 100644 --- a/pytools.py +++ b/pytools.py @@ -56,6 +56,8 @@ logging.info('either using csc.taito.fi without loading the mayavi2 module, or by invoking') logging.info('the system python interpeter by calling "./scriptname.py" instead of "python ./scriptname.py"') +logging.getLogger('matplotlib').setLevel(logging.WARNING) + # Run TeX typesetting through the full TeX engine instead of python's own mathtext. Allows # for changing fonts, bold math symbols etc, but may cause trouble on some systems. if not os.getenv('PTNOLATEX'):