Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
srosenbu committed Nov 28, 2024
1 parent 2388ef5 commit 1b49b92
Show file tree
Hide file tree
Showing 34 changed files with 5,824 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"rust-analyzer.inlayHints.typeHints.enable": true,
"rust-analyzer.inlayHints.parameterHints.enable": false
}
17 changes: 17 additions & 0 deletions py-comfe/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "py-comfe"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "comfe"
crate-type = ["cdylib"]

[dependencies]
numpy = {version = "0.19.0", features=["nalgebra"]}
nalgebra = "0.32.2"
pyo3 = "0.19.0"
strum = "0.25"
strum_macros = "0.25"
simba = "0.8.1"
18 changes: 18 additions & 0 deletions py-comfe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
![Test](https://github.com/srosenbu/comFE/actions/workflows/main.yml/badge.svg)
# comFE
A library for _**co**nstitutive **m**odels in **FE**niCSx_ written in Rust and Python.

## Goals

* My side project which should have a similar functionality as https://github.com/BAMresearch/fenics-constitutive. (BUT IN RUST)
* Currently this repo just reserves the name on github (naming stuff is hard)

## Rstrictions

* This is my personal Rust-Learning project, therefore don't expect anything groundbreaking.

## Installing

1. Clone the repository.
2. Install `mamba`
3. `mamba env create -f environment.yml`
16 changes: 16 additions & 0 deletions py-comfe/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: comfe
channels:
- conda-forge
dependencies:
- python>=3.10
- rust
- maturin
- pytest
- conda-ecosystem-user-package-isolation
- fenics-dolfinx=0.6.0
- numpy
- scipy
- pydantic
- pip
- pip:
- -e .
20 changes: 20 additions & 0 deletions py-comfe/environment_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: comfe
channels:
- conda-forge
dependencies:
- python>=3.10
- rust
- maturin
- pytest
- conda-ecosystem-user-package-isolation
- fenics-dolfinx
- numpy
- scipy
- pydantic
- ruff
- isort
- black
- pre-commit
- pip
- pip:
- -e .
32 changes: 32 additions & 0 deletions py-comfe/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["maturin>=0.15,<0.16"]
build-backend = "maturin"

[project]
name = "comfe"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]


[tool.maturin]
features = ["pyo3/extension-module"]
python-source = "python"

[tool.black]
line-length = 119

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 119

[tool.ruff]
line-length = 119
3 changes: 3 additions & 0 deletions py-comfe/python/comfe/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from comfe import cdm, helpers, laws

from .comfe import jaumann_rotation, jaumann_rotation_expensive
Loading

0 comments on commit 1b49b92

Please sign in to comment.