Skip to content

Commit afb918a

Browse files
committed
Update package
1 parent 2e12b27 commit afb918a

File tree

12 files changed

+96
-115
lines changed

12 files changed

+96
-115
lines changed

.github/workflows/python-package.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.10", "3.11", "3.12"]
19+
python-version: ["3.12"]
2020

2121
steps:
2222
- uses: actions/checkout@v3
@@ -27,11 +27,12 @@ jobs:
2727
- name: Install
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install pytest black
31-
python -m pip install .
32-
- name: Lint with black
30+
python -m pip install .[dev]
31+
- name: ruff
32+
uses: astral-sh/ruff-action@v3
3333
run: |
34-
black --check --verbose ./src
35-
- name: Test with pytest
34+
ruff check --fix
35+
ruff format
36+
- name: pytest
3637
run: |
3738
pytest

.gitignore

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ share/python-wheels/
2727
MANIFEST
2828

2929
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3232
*.manifest
3333
*.spec
3434

@@ -92,34 +92,34 @@ ipython_config.py
9292
# However, in case of collaboration, if having platform-specific dependencies or dependencies
9393
# having no cross-platform support, pipenv may install dependencies that don't work, or not
9494
# install all needed dependencies.
95-
#Pipfile.lock
95+
# Pipfile.lock
9696

9797
# UV
9898
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
9999
# This is especially recommended for binary packages to ensure reproducibility, and is more
100100
# commonly ignored for libraries.
101-
#uv.lock
101+
# uv.lock
102102

103103
# poetry
104104
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105105
# This is especially recommended for binary packages to ensure reproducibility, and is more
106106
# commonly ignored for libraries.
107107
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108-
#poetry.lock
109-
#poetry.toml
108+
# poetry.lock
109+
# poetry.toml
110110

111111
# pdm
112112
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113113
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114114
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115-
#pdm.lock
116-
#pdm.toml
115+
# pdm.lock
116+
# pdm.toml
117117
.pdm-python
118118
.pdm-build/
119119

120120
# pixi
121121
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122-
#pixi.lock
122+
# pixi.lock
123123
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124124
# in the .venv directory. It is recommended not to include this directory in version control.
125125
.pixi
@@ -131,6 +131,19 @@ __pypackages__/
131131
celerybeat-schedule
132132
celerybeat.pid
133133

134+
# Redis
135+
*.rdb
136+
*.aof
137+
*.pid
138+
139+
# RabbitMQ
140+
mnesia/
141+
rabbitmq/
142+
rabbitmq-data/
143+
144+
# ActiveMQ
145+
activemq-data/
146+
134147
# SageMath parsed files
135148
*.sage.py
136149

@@ -169,23 +182,23 @@ dmypy.json
169182
cython_debug/
170183

171184
# PyCharm
172-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174-
# and can be added to the global gitignore or merged into this file. For a more nuclear
175-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
176-
#.idea/
185+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187+
# and can be added to the global gitignore or merged into this file. For a more nuclear
188+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
189+
# .idea/
177190

178191
# Abstra
179-
# Abstra is an AI-powered process automation framework.
180-
# Ignore directories containing user credentials, local state, and settings.
181-
# Learn more at https://abstra.io/docs
192+
# Abstra is an AI-powered process automation framework.
193+
# Ignore directories containing user credentials, local state, and settings.
194+
# Learn more at https://abstra.io/docs
182195
.abstra/
183196

184197
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188-
# you could uncomment the following to ignore the entire vscode folder
198+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
201+
# you could uncomment the following to ignore the entire vscode folder
189202
.vscode/
190203

191204
# Ruff stuff:
@@ -194,13 +207,6 @@ cython_debug/
194207
# PyPI configuration file
195208
.pypirc
196209

197-
# Cursor
198-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200-
# refer to https://docs.cursor.com/context/ignore-files
201-
.cursorignore
202-
.cursorindexingignore
203-
204210
# Marimo
205211
marimo/_static/
206212
marimo/_lsp/

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
repos:
2-
- repo: https://github.com/psf/black-pre-commit-mirror
3-
rev: 25.1.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.14.3
45
hooks:
5-
- id: black-jupyter
6-
# It is recommended to specify the latest version of Python
7-
# supported by your project here, or alternatively use
8-
# pre-commit's default_language_version, see
9-
# https://pre-commit.com/#top_level-default_language_version
10-
language_version: python3.12
6+
# Run the linter.
7+
- id: ruff-check
8+
args: [ --fix ]
9+
# Run the formatter.
10+
- id: ruff-format

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.10"
11+
python: "3.12"
1212
# You can also specify other tool versions:
1313
# nodejs: "20"
1414
# rust: "1.70"

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
4848

4949
html_theme = "sphinx_book_theme"
50-
html_title = "tensorconvert"
50+
html_title = "fiberpy"
5151
html_static_path = ["_static"]
5252
html_theme_options = {
53-
"repository_url": "https://github.com/tianyikillua/tensorconvert",
53+
"repository_url": "https://github.com/tianyikillua/fiberpy",
5454
"use_repository_button": True,
5555
}

docs/notebooks/mechanics.ipynb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"metadata": {},
77
"outputs": [],
88
"source": [
99
"import numpy as np\n",
1010
"import matplotlib.pyplot as plt\n",
11+
"from fiberpy.mechanics import A2Eij, FiberComposite\n",
1112
"\n",
1213
"params = {\n",
1314
" \"figure.figsize\": (6, 4),\n",
@@ -23,8 +24,6 @@
2324
"}\n",
2425
"plt.rcParams.update(params)\n",
2526
"\n",
26-
"from fiberpy.mechanics import A2Eij, FiberComposite\n",
27-
"\n",
2827
"# Example RVE data\n",
2928
"rve_data = {\n",
3029
" \"rho0\": 1.14e-9,\n",

pyproject.toml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
[build-system]
2-
requires = ["setuptools>=42", "wheel"]
2+
requires = ["setuptools>=64", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.isort]
6-
profile = "black"
5+
[project]
6+
name = "fiberpy"
7+
version = "0.2.0"
8+
description = "Computional methods for fiber-reinforced composites"
9+
readme = "README.md"
10+
authors = [
11+
{ name = "Tianyi Li", email = "tianyikillua@gmail.com" }
12+
]
13+
requires-python = ">=3.12"
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Science/Research",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3",
19+
]
20+
dependencies = ["numpy", "scipy"]
21+
22+
[project.urls]
23+
"Homepage" = "https://github.com/tianyikillua/fiberpy"
24+
25+
[project.optional-dependencies]
26+
dev = ["pytest", "matplotlib"]

setup.cfg

Lines changed: 0 additions & 36 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/fiberpy/__about__.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
try:
2-
# Python 3.8
3-
from importlib import metadata
4-
except ImportError:
5-
import importlib_metadata as metadata
1+
from importlib import metadata
62

7-
try:
8-
__version__ = metadata.version("fiberpy")
9-
except Exception:
10-
__version__ = "unknown"
3+
__version__ = metadata.version("fiberpy")

0 commit comments

Comments
 (0)