Skip to main content

pyjams: a general Python package with miscellaneous utility functions used in several other packages.

Project description

A general Python package with miscellaneous utility functions used in several other packages.

Zenodo DOI PyPI version Conda version License Build status Coverage status Documentation status

About pyjams

pyjams is a general Python package offering miscellaneous functions in different categories, such as reading different file formats, Julian date routines, or calculating Elementary Effects. It has several subpackages offering constants or special functions, or objective functions to be used with scipy.optimize.

The package modernises and makes available routines of the JAMS Python library, which was created 2009 by Matthias Cuntz while at the Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany, and continued while at Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement (INRAE), Nancy, France.

The complete documentation of pyjams is available at:

http://pyjams.readthedocs.org/en/latest/

Installation

The easiest way to install is via pip:

pip install pyjams
Requirements

Content

Modules and functions are currently provided in the following categories:

Functions and modules (alphabetical)

Function/module

Short description

abc2plot

Write a, B, iii), … on a plot

alpha_equ_h2o

Equilibrium fractionation between liquid water and vapour

alpha_kin_h2o

Kinetic fractionation of molecular diffusion of water vapour

argmax

Wrapper for numpy.argmax, numpy.ma.argmax, and using max for Python iterables

argmin

Wrapper for numpy.argmin, numpy.ma.argmin, and using min for Python iterables

argsort

Wrapper for numpy.argsort, numpy.ma.argsort, and using sorted for Python iterables

closest

Index in array which entry is closest to a given number

color

Collection of color palettes and continuous color maps

const

Physical, mathematical, computational, isotope, and material constants

date2date

Convert date representations between different regional variants

date2en

Convert dates to English date format YYYY-MM-DD hh:mm:ss

date2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

date2us

Convert dates to American date format MM/DD/YYYY hh:mm:ss

directories_from_gui

Open dialog to select one directory

directory_from_gui

Open dialog to select several directories

division

Divide two arrays, return ‘otherwise’ if division by 0

div

Wrapper for division

elementary_effects

Morris measures mu, stddev and mu*

en2date

Convert dates to standard date format DD.MM.YYYY hh:mm:ss

en2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

en2us

Convert dates to American date format MM/DD/YYYY hh:mm:ss

esat

Saturation vapour pressure over water and ice

file_from_gui

Open dialog to select one file

files_from_gui

Open dialog to select one or several files

fr2date

Convert French dates to standard date format DD.MM.YYYY hh:mm:ss

fr2en

Convert French dates to English date format YYYY-MM-DD hh:mm:ss

fr2us

Convert French dates to American date format MM/DD/YYYY hh:mm:ss

fread

Read numbers from a file into 2D float array

fsread

Read numbers and strings from a file into 2D float and string arrays

functions

Special functions for testing optimisations, sensitivity analysis, several forms of the logistic function and its derivatives, and other functions to be used with scipy.optimize

int2roman

Integer to Roman numeral conversion

mad

Median absolute deviation test

mcPlot

Matthias Cuntz’ standard plotting class

morris_sampling

Sampling of optimised trajectories for Morris measures / Elementary Effects

position

Position arrays of subplots to be used with add_axes

roman2int

Roman numeral to integer conversion

screening

Parameter screening using Morris’ method of Elementary Effects

signature2plot

Write a copyright notice on a plot

sread

Read strings from a file into 2D string array

str2tex

Convert strings to LaTeX strings in math environment used by matplotlib’s usetex

tee

Prints arguments on screen and in file, like Unix/Linux tee utility

text2plot

Write text on a plot

us2date

Convert dates to standard date format DD.MM.YYYY hh:mm:ss

us2en

Convert dates to English date format YYYY-MM-DD hh:mm:ss

us2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

xlsread

Same as xread

xlsxread

Same as xread

xread

Read numbers and strings from Excel file into 2D float and string arrays

Functions and modules per category

Array Manipulation

Function/module

Short description

argmax

Wrapper for numpy.argmax, numpy.ma.argmax, and using max for Python iterables.

argmin

Wrapper for numpy.argmin, numpy.ma.argmin, and using min for Python iterables.

argsort

Wrapper for numpy.argsort, numpy.ma.argsort, and using sorted for Python iterables.

closest

Index in array which entry is closest to a given number.

Ascii Files

Function/module

Short description

fread

Read numbers from a file into 2D float array

fsread

Read numbers and strings from a file into 2D float and string arrays

sread

Read strings from a file into 2D string array

Data Processing

Function/module

Short description

mad

Median absolute deviation test

Date and Time

Function/module

Short description

date2date

Convert date representations between different regional variants

date2en

Convert dates to English date format YYYY-MM-DD hh:mm:ss

date2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

date2us

Convert dates to American date format MM/DD/YYYY hh:mm:ss

en2date

Convert dates to standard date format DD.MM.YYYY hh:mm:ss

en2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

en2us

Convert dates to American date format MM/DD/YYYY hh:mm:ss

fr2date

Convert French dates to standard date format DD.MM.YYYY hh:mm:ss

fr2en

Convert French dates to English date format YYYY-MM-DD hh:mm:ss

fr2us

Convert French dates to American date format MM/DD/YYYY hh:mm:ss

us2date

Convert dates to standard date format DD.MM.YYYY hh:mm:ss

us2en

Convert dates to English date format YYYY-MM-DD hh:mm:ss

us2fr

Convert dates to French date format DD/MM/YYYY hh:mm:ss

Isotopes

Function/module

Short description

alpha_equ_h2o

Equilibrium fractionation between liquid water and vapour

alpha_kin_h2o

Kinetic fractionation of molecular diffusion of water vapour

Math

Function/module

Short description

division

Divide two arrays, return ‘otherwise’ if division by 0

div

Wrapper for division

elementary_effects

Morris measures mu, stddev and mu*

functions

Special functions for testing optimisations, sensitivity analysis, several forms of the logistic function and its derivatives, and other functions to be used with scipy.optimize

morris_sampling

Sampling of optimised trajectories for Morris measures / Elementary Effects

screening

Parameter screening using Morris’ method of Elementary Effects

Meteorology

Function/module

Short description

esat

Saturation vapour pressure over water and ice

Miscellaneous

Function/module

Short description

const

Physical, mathematical, computational, isotope, and material constants

directories_from_gui

Open dialog to select one directory

directory_from_gui

Open dialog to select several directories

file_from_gui

Open dialog to select one file

files_from_gui

Open dialog to select one or several files

int2roman

Integer to Roman numeral conversion

roman2int

Roman numeral to integer conversion

tee

Prints arguments on screen and in file, like Unix/Linux tee utility

Plotting

Function/module

Short description

abc2plot

Write a, B, iii), … on a plot

color

Collection of color palettes and continuous color maps

int2roman

Integer to Roman numeral conversion

mcPlot

Matthias Cuntz’ standard plotting class

position

Position arrays of subplots to be used with add_axes

roman2int

Roman numeral to integer conversion

signature2plot

Write a copyright notice on a plot

str2tex

Convert strings to LaTeX strings in math environment used by matplotlib’s usetex

text2plot

Write text on a plot

Special Files

Function/module

Short description

xlsread

Same as xread

xlsxread

Same as xread

xread

Read numbers and strings from Excel file into 2D float and string arrays

License

pyjams is distributed under the MIT License. See the LICENSE file for details.

Copyright (c) 2012-2022 Matthias Cuntz, Juliane Mai, Stephan Thober, and Arndt Piayda

The project structure of pyjams has borrowed heavily from welltestpy by Sebastian Müller.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyjams-1.17.tar.gz (398.4 kB view hashes)

Uploaded Source

Built Distribution

pyjams-1.17-py3-none-any.whl (171.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page