semvec/pypi-packages huggingface dataset:
numerous-engine 0.5.2
Numerous  - an object-oriented modelling and simulation engine.
Requires Python: >=3.11

<img src="https://framerusercontent.com/modules/0NBlkpwGRAx5GVr0Qowa/WoxIE6GzMmPgU6UV3heH/assets/JlHMAnfxSjyEebKRUvDVAubjBdE.jpg" width="400" height="200">

[![CircleCI](https://circleci.com/gh/fossilfree/numerous.svg?style=shield)](https://circleci.com/gh/fossilfree/numerous)
---------------------------------------------------------------------------------------------------

Numerous — an object-oriented modelling and simulation engine 
================================================================

Reasons for developing a python-based object-oriented simulation engine 

The arguments for a python simulation engine are numerous: 

* In order to take advantage of cloud based computing power a run-anywhere solution is preferred
* Open-source to eliminate the need of complex licenses for deploying thousands of simulations
* Direct connection with machine-learning and artificial intelligence libraries through the most popular programming language for data science
* Leveraging packages from the vast community seamlessly


Philosophy and Motivation for Object-Oriented Modelling
--------------------------------------------------------

As systems becomes complex the number of equations and variables grow fast and the overview is lost for the model developer. The idea behind this engine is to allow the model developer focus on one familiar object at a time and setup simulations for validation – and then combine these objects together to form complex interacting systems in a simple way where all the general tedious work is handled by the engine. 

Quick start
--------------------------------------------------------
To install using pip use `pip install numerous-engine`


You can get started quickly here with a simple example:

```python
from numerous.engine import model, simulation
from numerous.examples.dampened_oscillator.dampened_oscillator import OscillatorSystem
#Define simulation
s = simulation.Simulation(
     model.Model(OscillatorSystem('system')),
    t_start=0, t_stop=10, num=100, num_inner=100, max_step=0.1
)
#Solve
s.solve()
simulation_result = s.model.historian_df
```


Or follow one of our comprehensive tutorials: 

 * [Bouncing_Ball](https://github.com/fossilfree/numerous/blob/master/examples/Bouncing_Ball/Bouncing%20Ball%20Example.ipynb)
	a model of a ball dropping from a certain height and bouncing off the ground, until it finally comes to rest
 * [Two_Tanks_System](https://github.com/fossilfree/numerous/blob/master/examples/Two_Tanks_System/TwoTanks_System.ipynb)
	two tanks are placed on top of each other and connected by a valve.

Documentation can be found on [readthedocs](https://numerous.readthedocs.io/).

Or you can get familiar with the concepts we have used to abstract away building complex interacting systems right inside python.
pytest_when 1.1.0
Utility which makes mocking more readable and controllable
Requires Python: >=3.8

# pytest-when

Plugin provides a `when` fixture, which enables the following way of mocking
the python objects:

```python
(
    when(some_object, "attribute")
    .called_with(1, 2, when.markers.any)
    .then_return("mocked")
)
```

It is readable and gives you a way to enable the mock only for a specific
argument's values. In this the attribute will be mocked, for specific
first two arguments and any third argument.

Inspired by <https://github.com/mockito/mockito-scala>

`.called_with` method arguments are compared with the
real callable signature and gives additional protection against
changing the real callable interface.

## Installation

```bash
pip install pytest-when
```


## Usage

After installing the package a new fixture `when` will be available.
See the following example how to use it:

```python
# class which we're going to mock in the test
class Klass1:
    def some_method(
        self,
        arg1: str,
        arg2: int,
        *,
        kwarg1: str,
        kwarg2: str,
    ) -> str:
        return "Not mocked"


def test_should_properly_patch_calls(when):
    when(Klass1, "some_method").called_with(
        "a",
        when.markers.any,
        kwarg1="b",
        kwarg2=when.markers.any,
    ).then_return("Mocked")

    assert (
        Klass1().some_method(
            "a",
            1,
            kwarg1="b",
            kwarg2="c",
        )
        == "Mocked"
    )
    assert (
        Klass1().some_method(
            "not mocked param",
            1,
            kwarg1="b",
            kwarg2="c",
        )
        == "Not mocked"
    )

# if you need to patch a function
def test_patch_a_function(when):
    when(example_module, "some_normal_function").called_with(
        "a",
        when.markers.any,
        kwarg1="b",
        kwarg2=when.markers.any,
    ).then_return("Mocked")

    assert (
            example_module.some_normal_function(
                "a",
                1,
                kwarg1="b",
                kwarg2="c",
            )
            == "Mocked"
    )
    assert (
            example_module.some_normal_function(
                "not mocked param",
                1,
                kwarg1="b",
                kwarg2="c",
            )
            == "Not mocked"
    )
```

It is possible to use 'when' with class methods and standalone functions
(in this case cls parameter will become a python module).

You can patch multiple times the same object with different "called_with"
parameters in a single test.

You can also patch multiple targets (cls, method)

See more examples at:
[test_integration](tests/test_integration.py)


## Setup for local developement

Requirements:
1. pdm <https://pdm.fming.dev/latest/#installation>
2. python3.8 (minimum supported by a tool)

```bash
pdm install
```

To run tests and linters use:
```bash
make test
make lint
```
StreamJam 0.0.1
Unifying frontend and backend into one Pythonic experience for sleek, interactive web apps.

# StreamJam 🎵

Unifying frontend and backend into one Pythonic experience for sleek, interactive web apps.

## Overview

StreamJam allows developers to craft both the frontend and backend of web applications using just Python. Inspired by the reactivity of Svelte and the real-time capabilities of Phoenix LiveView, StreamJam offers a streamlined approach to web development.

## Features

- **Reactive Components**: Write dynamic, interactive components using Python.
- **Unified Development**: No need to juggle between frontend and backend languages. Everything's in Python!
- **Elegant Syntax**: Inspired by modern frameworks like Svelte, StreamJam keeps your codebase clean and concise.

## Installation

```bash
pip install streamjam
```

## Example: Countdown Timer

Here's a simple countdown timer using StreamJam:

**Filename**: `Timer.pie`

```python
from streamjam import pie

template = """
<div class="countdown-timer">
    <h1>{title}</h1>
    <p>Time left: {time_left} seconds</p>
    <button onclick={start}>Start</button>
    <button onclick={stop}>Stop</button>
</div>
"""

class Component:
    title: pie[str] = "New Timer"
    time_left: pie[int] = 10
    interval = None  # not a pie

    def start(self):
        self.interval = setInterval(self.tick, 1000)

    def tick(self):
        if self.time_left > 0:
            self.time_left -= 1  # changes will be sent to the client
        else:
            self.stop()

    def stop(self):
        clearInterval(self.interval)
        self.interval = None

style = """
.countdown-timer {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}
"""

```

## Documentation

Visit our [official documentation](#) for detailed guides, API references, and more.

## Contributing

Contributions are always welcome! Please see our [contributing guidelines](#) for more details.

## License

[MIT License](LICENSE)