[ Log In | Sign Up | Lost password? ]


Extending the grids' expressions in Cowry

The Python infrastructure of Cowry allows to extend the features of the application in several ways and make users more productive. In this post we show how to extend the set of expressions available in the computed fields of data grids. Say that you want to see in the time series data grid the standard deviation of the series. The first step is to put in the configuration script after_importing_db.py (optional, not necessarily present) the following Python code which enables the usage of the 'numpy' library in expressions:

Now you can put the following expression in the data grid:

and get what you want. This way you can also write your 'mylibrary' library of functions, put it in the directory defined as common path and finally you can use it as in the previous example, just substituting 'numpy' with 'mylibrary' and 'std' with your function name, eventually changing arguments.