PyResiFlex is a simple set of tools in Python to obtain load (plasma) Resistance from analysis of pulse reFlexions.
Project description
PyResiFlex
PyResiFlex is a simple set of tools in Python to obtain load (plasma) Resistance from analysis of pulse reFlexions.
Full user documentation (advanced install and examples) are available on the PyResiFlex Website.
Getting Started
Install
Assuming you have Python installed with the Anaconda distribution you can use pip:
pip install pyresiflex
Quick Start
Compute the voltage at the load, for a 5-m cable and a time-varying resistance:
# Import necessary libraries.
import matplotlib.pyplot as plt
import numpy as np
from pyresiflex.cable.cable import PerfectCable
from pyresiflex.generator.generator_real_impedance import ConstantGenerator
from pyresiflex.load.time_varying_resistance import PlasmaResistanceLinearFall
from pyresiflex.solver.purely_resistive_solution import PurelyResistiveSolution
# Create a purely resistive solution with a time-varying load resistance.
solution = PurelyResistiveSolution(
cable=PerfectCable(L=5, Z_c=75, c=2e8),
generator=ConstantGenerator(R_g=1, U_g=5e3),
load=PlasmaResistanceLinearFall(
Z_start=1e2, Z_end=10, t_start_fall=20e-9, t_end_fall=30e-9
),
)
# Solve the system at specific time points.
times = np.linspace(0, 40e-9, 1000)
# Here, the solution is computed at 5 meters.
solution.solve(x=5, t=times)
# Plot the voltage response over time.
fig, ax = plt.subplots()
ax.plot(times * 1e9, solution.voltage * 1e-3, color="k")
ax.set_xlabel(r"$\mathregular{t \, [ns]}$")
ax.set_ylabel(r"$\mathregular{V \, [kV]}$")
ax.set_title("Load voltage against time")
plt.show()
Example
Example of the reproduction of the Minesi2022 experiment using PyResiFlex.
Workflow for developers/contributors
GitHub Codespaces has been set up, so you can click on this button to quickly code and run the examples:
You can also follow the instructions below, to set up the project on your machine:
- First, clone the repository with
git clone https://github.com/pag1pag/pyresiflex.git. - Since this package uses uv, install it by following instructions on their website.
- Update this Python package manager with
uv self update. - Run
uv syncto create a virtual environment at.venv, with the latest version of Python and all the necessary dependencies. - To test if the package is working, run
uv run pytest. All tests should pass.
Next, you just need to activate the virtual environment with:
- (macOS and Linux)
source .venv/bin/activate - (Windows)
.venv\Scripts\activate
Do not forget to activate it each time you are using this project.
Before pushing to GitHub, run the following commands in a terminal (with the virtual environment activated):
- Update dependencies with
just update-env. - Run quality assurance checks (code linting) with
just qa. - Run type checks with
just type-check. - Run unit tests with
just tests. - Run unit tests with coverage and generate a badge with
just tests-cov. - Build the documentation with
just build-docs.
You could also run just to run all the above commands in one go.
Manually building the package
If you want to install pyresiflex to another environment, you can build the package and install it with pip:
(pyresiflex) uv buildwill build a wheel/whlin the folder./dist.- Activating another env, called
other_env. (other_env) pip install path/to/file.whlshould installpyresiflexinother_env.
Who do I talk to?
- Pierre-Antoine Goutier, Spark Cleantech & EM2C Lab, 2024-present, pierre-antoine.goutier@spark-cleantech.eu
References
A list of references used is available at the reference section.
Note
According to Oxford Learner's Dictionaries, reflexion is an old spelling of reflection.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyresiflex-0.2.0.tar.gz.
File metadata
- Download URL: pyresiflex-0.2.0.tar.gz
- Upload date:
- Size: 5.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e60c096100d4abcb0219b61fd8ea81f121220b15905698cb9cd1bbd4d5807b
|
|
| MD5 |
af5009f1769ed6de2a3371d70bee66d2
|
|
| BLAKE2b-256 |
0dfa9776244399bf026334e06d99cb04dfad23b816220482b6cc4f829086ab9c
|
Provenance
The following attestation bundles were made for pyresiflex-0.2.0.tar.gz:
Publisher:
publish.yml on pag1pag/pyresiflex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyresiflex-0.2.0.tar.gz -
Subject digest:
a0e60c096100d4abcb0219b61fd8ea81f121220b15905698cb9cd1bbd4d5807b - Sigstore transparency entry: 2034098797
- Sigstore integration time:
-
Permalink:
pag1pag/pyresiflex@ea987023f347920bbfc2bb5b9230429a78360bf4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pag1pag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea987023f347920bbfc2bb5b9230429a78360bf4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyresiflex-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pyresiflex-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f56ab16a5ad34fca4c92d6376d96d099812695b9a036b54a6739e05fe7d7816
|
|
| MD5 |
5700492967488e9d3909d542f9b7ee7e
|
|
| BLAKE2b-256 |
528680063cbfa916a8ddbc29198db248d426444f1f606769275a35b4bedb3470
|
Provenance
The following attestation bundles were made for pyresiflex-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on pag1pag/pyresiflex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyresiflex-0.2.0-py3-none-any.whl -
Subject digest:
9f56ab16a5ad34fca4c92d6376d96d099812695b9a036b54a6739e05fe7d7816 - Sigstore transparency entry: 2034098886
- Sigstore integration time:
-
Permalink:
pag1pag/pyresiflex@ea987023f347920bbfc2bb5b9230429a78360bf4 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pag1pag
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea987023f347920bbfc2bb5b9230429a78360bf4 -
Trigger Event:
release
-
Statement type: