Lattices generation and simulation
treillis (/tʁɛji/, French for truss) is a Python library built to help researchers and whoever is interested in microlattices. It provides tools to modelize 2D and 3D microlattices, to compute their elastic properties as well as calculate stresses, strains and elastic constants. It was written by experimental physicists with the language that they know, and may need some optimization work, but aims at being as easy to use and iterate on as possible.
treillis offers tools to
- generate lattices from different periodic or random base meshes
- modify lattice structures by playing with the connectivity, the element shape, the node position...
- display lattices in paper-quality figures or in interactive 3D figures
- apply solid mechanics models to the lattices by treating them as basic meshes
Install
Ideally, if we had time and more experience with Python and building packages in general, the requirements would be much lighter. As is, treillis requires:
- Python >= 3.11
- numba <0.66
- numpy < 2.5
- scipy
- dill
- tqdm
- ipyparallel
- meshio
- matplotlib
- datoviz
- pytables
- scikit sparse
Install from the source as editable
Clone the repository.
Using Pixi
Install the latest version of Pixi, open a command terminal in the folder root and input pixi shell.
Using conda
Because treillis uses Datoviz for 3D interactive plotting, which does not yet have a conda release, you need to create the environment before being able to install
- Open a conda command terminal in the folder root.
- Create the treillis environment from environment.yml with
conda env create --name <YOUR ENVT NAME> --file=environment.yml
- activate the environment
conda activate <YOUR ENVT NAME> - install treillis in the environment as editable with
conda install conda-build
conda develop .
OR install treillis with conda install treillis
Pypi
Because the mechanics module of treillis is based on scikit-sparse, it has the same issues with pip install: SuiteSparse needs to be setup first before building the package. Hence, the next paragraph is copied from the scikit-sparse documentation:
To install
scikit-sparse, you need to have the SuiteSparse library installed on your system.It is recommended that you install SuiteSparse and the scikit-sparse dependencies in a virtual environment, to avoid conflicts with other packages. We recommend using Anaconda:
$ conda create -n scikit-sparse python>=3.10 suitesparse $ conda activate scikit-sparseIf you are not using Anaconda, you can install SuiteSparse using your preferred package manager.
On MacOS, you can use Homebrew:
$ brew install suite-sparseOn Debian/Ubuntu systems, use the following command:
$ sudo apt-get install python-scipy libsuitesparse-devOn Arch Linux, run:
$ sudo pacman -S suitesparse
Documentation
Find the treillis documentation here.
License
treillis is under a GNU lesser general public license v3.0. See LICENSE.
Citation
If you use this library, please kindly cite us! See the CITATION file.
Metadata
Release files for treillis 1.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| treillis-1.4.2.tar.gz | 44.0 MB | Without provenance | Details for treillis-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| treillis-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for treillis-1.4.2-py3-none-any.whl |
Total release size: 88.6 MB
Release files / treillis-1.4.2.tar.gz
| Download URL | treillis-1.4.2.tar.gz |
|---|---|
| Size | 44.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
260d5b220724891b8f81bcf5607ab7b3092236be64c6b2e6b893d6f5fa9a0346
|
|
BLAKE2b-256 checksum How to use checksums |
306348d584327324507cba05e56ae20ff040b74d144dbffb05c142d088e870f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Release files / treillis-1.4.2-py3-none-any.whl
| Download URL | treillis-1.4.2-py3-none-any.whl |
|---|---|
| Size | 44.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ddc068cc593274b925cb8c8c0e6318ecb49c0e6a86a00ab539fd1b178f05d31
|
|
BLAKE2b-256 checksum How to use checksums |
e2bafc56d2db390e05f0260d248c1aabcb6337d2f881a5b136e2d9594e1bb2d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.0
|
Security for treillis 1.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.