Skip to content

Commit

Permalink
Add Rust Engine (#3)
Browse files Browse the repository at this point in the history
* 🚧 WIP: Add the Rust Engine

* ⬆️ Dependencies: Upgrade the `poetry.lock` file

* ⬆️ Dependencies: Upgrade the dependencies to use the maturin ones

* ⚰️ Remove: Delete old .pyi files

* 🚧 WIP: Add a better `build-method` in Rust

* 🚚 Movement: Move files from one place to another

* 🩹 Patch: Make the expression to plot the variables values and add config params to the `.plot()` method of the expression

* 🚧 WIP: Add the first example

* 🚧 WIP: Add the improved version of the gradient_descent in Rust, and a better lib implementation

* ✨ Add: Include a new and functional engine for Rust in `pymath_compute`

* ✨ Add: Add the first solver, being the `opt_solver` method

* ✏️ Typo: Add `.pyi` for the Rust modules

* 🎨 Improve: Minor improve in the `variable` class

* ✨ Add: include an example of how to use this package, and more info in the `README.md` of the packages

* 📝 Doc: Add more information in the `README.md`

* 👷 CI: Add an automatic publish github action

* 🔖 Tag: Bump version `0.3.0`

* ⚰️ Remove: Delete useless code
  • Loading branch information
ricardoleal20 authored Jul 15, 2024
1 parent ad4fb65 commit d9f399b
Show file tree
Hide file tree
Showing 34 changed files with 2,346 additions and 117 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/publish_in_pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Publish package on PyPI 🚀

on:
push:
tags:
- '**'
- 'v[0-9]+.[0-9]+.[0-9]+'

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing *
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.3.0] - 15/07/2024

### Added

- [Engine]: The engine for mathematical calculations, made it on Rust
- [OptSolver]: A Python solver written directly on Python that include an interface for easier implementation of different mathematical problems.
- [Examples]: Some examples of how to use this package in mathematical problems.

## [0.2.0] - 09/07/2024

### Added
Expand Down
239 changes: 239 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "pymath_compute_engine"
version = "0.1.0"
edition = "2021"

[dependencies]
pyo3 = { version = "0.16", features = ["extension-module"] }

[lib]
crate-type = ["cdylib"]

[package.metadata.maturin]
name = "pymath_compute.engine"
Loading

0 comments on commit d9f399b

Please sign in to comment.