semvec/pypi-packages huggingface dataset:
factoryos-lib 0.0.17
A generic and reusabe package of machine learning models to use for Valiot prodicts
Requires Python: >=3.7

# Valiot FactoryOS Library

This is a repository of algorithms for solving different issues using Valiot Worker jobs as base

## Current list of algorithms

### Filters
1. MovingAverage: Uses the average of the last n elements
2. ExponentialMovingAverage: Uses the average of the last n elements using exponential weight
3. Stats: Calculate the standard deviation and variance anc store in a variable

### AI
TBD

## Installation
```
pip install factoryos_lib
```

# Getting started

There are two ways to execute jobs from the library 

1. Create a job and call the execute function

```
@vw.job(name='TEST_DATA_STATS',
        alias='TEST_DATA_STATS',
        description="t",
        queueType=QueueType.ON_DEMAND,
        schedule="*/60 * * * *",
        enabled=True,
        lockRequired=True
        )

def stats_executor(job, log, update_job, get_job_status, context, update_context, **kwargs):
    f = Stats()
    kwargs = {"input": {
        "variable": "TEST_DATA"
    }}
    f.execute(job, log, update_job, get_job_status, context, update_context, **kwargs)
```

2. Using array of jobs JSON

```
from factoryos_lib.execution import execute_jobs


jobs = [
    {
        "model": "ExponentialMovingAverage",
        "parameters": {
            "name": 'TEST_DATA_EMA_FILTER',
            "alias": '',
            "description": "Description",
            "queueType": QueueType.FREQUENCY,
            "schedule": "*/60 * * * *",
            "enabled": True,
            "lockRequired": True

        },
        "input": {
            "variable": "TEST_DATA",
            "window": 10,
            "block_size": 150,
            "restart": True
        }
    }
]

execute_jobs(worker, jobs)
worker.run(interval=2)

```

## Tests

TBD
quadmompy 0.9.7
Tools for moments, Gaussian quadrature,

=============
**QuadMomPy**
=============

QuadMomPy is a library for all sorts of fun with moments, Gaussian quadratures, orthogonal polynomials and quadrature-based moment methods for the solution of spatially homogeneous population balance equations.


Installation
------------
The QuadMomPy package can be easily installed by
::

    pip install quadmompy

or from the project repository
::

    pip install -e .

A comprehensive documentation and additional examples are only available in the project repository on GitLab/GitHub. Use 

::

    git clone https://gitlab.com/puetzm/quadmompy.git

to clone the code from the GitLab repository or

::

    git clone https://github.com/puetzmi/quadmompy.git

to clone from the project mirror on GitHub.

The repository also includes a `Dockerfile` to run tests and use the QuadMomPy package in a docker image.


Usage
-----
A simple example of a moment inversion using the quadrature method of moments with the Wheeler algorithm to compute a Gaussian quadrature rule from a set of moments is given below.

.. code:: python

    import numpy as np
    from quadmompy import qbmm
    from quadmompy.qbmm.univariate import Qmom
    from quadmompy.core.inversion import Wheeler

    # Create Qmom object using the Wheeler
    # algorithm for moment inversion
    qmom = qbmm.new(qbmm_type=Qmom, qbmm_setup={'inv_type': Wheeler})

    # Nodes `x` and weights `w` of a weighted
    # sum of degenerate distributions
    x = np.array([-0.5, 0.1, 1., 1.4])
    w = np.array([0.15, 0.4, 0.4, 0.05])

    # Compute moments of the distribution
    n = len(x)
    moments = np.vander(x, 2*n).T[::-1]@w

    # Invert moments to obtain quadrature nodes and
    # weights, which should, in this particular
    # equal the nodes and weights defined above.
    x_quad, w_quad = qmom.moment_inversion(moments)
    print(f"x = {x_quad}")
    print(f"w = {w_quad}")

For more examples of how to use the numerous classes provided with this package, see the `tests` directory and the `examples` directory in the project repository on GitLab (`<https://gitlab.com/puetzm/quadmompy.git>`_) and the project mirror on GitHub(`<https://github.com/puetzmi/quadmompy.git>`_).


License
-------

Copyright (c) 2022 Michele Puetz.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.