semvec/pypi-packages huggingface dataset:
jp-odesolver 0.0.4
A simple Python project for solving and eventually plotting numerically obtained solutions for ODEs
Requires Python: >=3.9

# odesolver

A simple tool to solve ODEs numerically and plot the solution.


## Features 
    - Solve ODEs with the Euler method 
    - Solve ODEs with the RK4 method

## Installation

You can install the package via **PyPI** or from **source**.

### Install from PyPI

```bash
    pip install jp-odesolver
```

### Install from Source (GitHub)

```bash
    git clone https://github.com/patrikj-info/odesolver.git
    cd odesolver
    pip install .
```

## Usage

### Creating ODE

```Python
    from odesolver.ode import ODE

    # load homogenous ODE
    ode = ODE.readHomogenousODE("4.0x'' + 0.1x' + 2.0x")

    import numpy as np

    def funct(t,x):
        return np.cos(t)

    # load inhomogenous ODE
    ode = ODE.readODE("4.0x'' + 0.1x' + 2.0x", inhom=funct)
```


### Solving using Euler's Method

```Python
    from odesolver.odesolver import ODESolver

    # find solution using Euler's method
    sol = ODESolver.solveODE(ode=ode, method="euler", initial_conditions=[1.0, 0.0], t0=0, t_final=10, h=0.01)
```

### Solving using Runge-Kutta Order 4
```Python
    # find solution using Runge-Kutta 4
    sol = ODESolver.solveODE(ode=ode, method="rk4", initial_conditions=[1.0, 0.0], t0=0, t_final=10, h=0.01)
```

### Plotting Solution 
```Python
    from odesolver.solver import unpackData
    from odesolver.plotter import Plotter

    # retrieve data from solution
    t,x = unpackData(data=sol, axes=(0,1))

    # plot solution
    Plotter.plot(t, x, filename="harm_oscillator_euler.png", fileformat="png")
```

### Creating Animated Graphs
```Python
    # plot solution
    # NOTE: the creation of the graph may take a relatively long time. Changing the fps may prove useful.
    Plotter.plot(t, x, animation=True, filename="harm_oscillator_euler.gif", fileformat="gif")
```

### N-dimensional ODEs
Following, an example with N = 2 will be regarded.

```Python
    from numpy import sqrt
    import numpy as np
    from odesolver.ode import ODE
    from odesolver.plotter import Plotter
    from odesolver.odesolver import ODESolver

    g = 4 * np.pi ** 2  # Gravitational constant Astronomical Units
    m = 3.00349e-6      # Earth's mass in solar mass units (sun=1 mass)
    dist = 1         # Earth-Sun distance AU
    v = 2 * np.pi       # Orbital speed Earth (r=1AU) T=1 yr

    def betrag(x):
        sum = 0
        for i in range(len(x)):
            sum += x[i]**2
        return sqrt(sum)

    x0 = np.array([0, 0])

    def funct(t, x):
        return -g * x[0]/betrag(x[0] - x0)**3


    ode = ODE(2, funct, 2)
    sol = ODESolver.solveODE(ode, method="rk4", initial_conditions = [[0,dist], [v,0]], t0=0, t_final=200, h=0.01)
    t, r, v = unpackData(sol)
    
    Plotter.plot(xdata=r.T[0], ydata=r.T[1], filename="test.png", fileformat="png", xlabel="x", ylabel="y")
```
nwa-stdlib 1.11.0
The NWA-stdlib module.
Requires Python: <3.15,>=3.11

# Network Automation Standard Library

[![pypi_version](https://img.shields.io/pypi/v/nwa-stdlib?color=%2334D058&label=pypi%20package)](https://pypi.org/project/nwa-stdlib)
[![Supported python versions](https://img.shields.io/pypi/pyversions/nwa-stdlib.svg?color=%2334D058)](https://pypi.org/project/nwa-stdlib)
[![codecov](https://codecov.io/github/workfloworchestrator/nwa-stdlib/graph/badge.svg?token=9XWVHKKF06)](https://codecov.io/github/workfloworchestrator/nwa-stdlib)

This library contains the functions and utilities that are shared by most Network Automation projects built at SURF.

## Installation

To install the package from PyPI:

```bash
pip install nwa-stdlib
```

## Development

### Virtual Environment

Steps to setup a virtual environment.

#### Step 1:

Create and activate a python3 virtualenv.

#### Step 2:

Install flit to enable you to develop on this repository:

```bash
pip install flit
```

#### Step 3:

To install all development dependencies:

```bash
flit install --deps develop
```

All steps combined into 1 command:

```bash
python -m venv .venv && source .venv/bin/activate && pip install -U pip && pip install flit && flit install --deps develop
```

### Unit tests

Activate the virtualenv and run the unit tests with:

```bash
pytest
```

### Pre-commit

This project uses [pre-commit](https://pre-commit.com/) to automatically run a number of checks before making a git commit.
The same checks will be performed in the CI pipeline so this can save you some time.

First ensure you have pre-commit installed.
It is recommended to install it outside the virtualenv.
On Linux and Mac, pre-commit is available in most package managers. Alternatively you can install it globally with [pipx](https://github.com/pypa/pipx).

Once pre-commit is installed, go into the project root and enable it:
```bash
pre-commit install
```

This should output `pre-commit installed at .git/hooks/pre-commit`. The next time you run `git commit` the pre-commit hooks will validate your changes.

### Bump version

Depending on the feature type, run bumpversion (patch|minor|major) to increment the version you are working on. For
example to update the increment the patch version use
```bash
bumpversion patch
```

## Supported Python versions

nwa-stdlib must support the same python versions as [orchestrator-core](https://github.com/workfloworchestrator/orchestrator-core).

Exceptions to this rule are:
* **A new python version is released:** nwa-stdlib should support the new version before orchestrator-core does
* **Support for an old python version is dropped:** nwa-stdlib should drop the python version after orchestrator-core does
molecule-glesys 0.7
Molecule Glesys Plugin :: run molecule tests in Glesys Cloud
Requires Python: >=3.10

# Molecule Glesys Plugin

Molecule driver to spin up and run tests in Glesys Cloud servers for easy testing

# Installation and Usage

```
pip install molecule-glesys
```

Create a new role with molecule using this driver:

```
molecule init role <role_name> -d molecule-glesys
```

Configure `<role_name>/molecule/default/molecule.yml` with required parameters.  
Sample config:

```yaml
dependency:
  name: galaxy
  options:
    requirements-file: molecule/default/collections.yml
driver:
  name: molecule-glesys
  vm_username: molecule

platforms:
  - name: "demo.demo-ubuntu-20-04"
    template: Ubuntu 20.04 LTS (Focal Fossa)
    description: "ubuntu-20-04"
    datacenter: "Falkenberg"
    platform: KVM
    cpus: 2
    memory: 2048
    disk: 20

  - name: "demo.demo-debian-11"
    template: Debian 11 (Bullseye)
    description: "debian-11"
    datacenter: "Falkenberg"
    platform: KVM
    cpus: 2
    memory: 2048
    disk: 20

provisioner:
  name: ansible
verifier:
  name: ansible
```

# API Authentication

Use the environment variables `GLESYS_PROJECT` and `GLESYS_APIKEY` to authenticate with the Glesys API.

```
export GLESYS_PROJECT=CL12345
export GLESYS_APIKEY=abc123foo9876
```

# License

The [MIT](LICENSE) License.