Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Prek checks
on: [push, pull_request]

jobs:
prek:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: j178/prek-action@v1
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
hooks:
- id: ruff-check
args: [--fix]
2 changes: 0 additions & 2 deletions Examples/Circular Bin with Conical Hopper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from math import pi
from Pynite.FEModel3D import FEModel3D
from Pynite.Mesh import FrustrumMesh, CylinderMesh

t = 0.25/12
E = 29000*1000*12**2
Expand Down
1 change: 0 additions & 1 deletion Examples/Simple Beam - Factored Envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy as np

# Import 'Visualization' for rendering the model
from Pynite import Visualization

# Create a new finite element model
simple_beam = FEModel3D()
Expand Down
1 change: 0 additions & 1 deletion Examples/Simple Beam - Point Load.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from Pynite import FEModel3D

# Import 'Visualization' for rendering the model
from Pynite import Visualization

# Create a new finite element model
simple_beam = FEModel3D()
Expand Down
2 changes: 1 addition & 1 deletion Pynite/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import TYPE_CHECKING
from math import isclose

from numpy import array, atleast_2d, zeros, subtract, matmul, divide, seterr, nanmax
from numpy import array, zeros, subtract, matmul
from numpy.linalg import solve

from Pynite.LoadCombo import LoadCombo
Expand Down
3 changes: 1 addition & 2 deletions Pynite/FEModel3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import TYPE_CHECKING, Literal

import numpy as np
from math import floor
from numpy.linalg import solve

from Pynite.Node3D import Node3D
Expand Down Expand Up @@ -2563,7 +2562,7 @@ def analyze_PDelta(self, log=False, check_stability=True, max_iter=30, sparse=Tr

# Import `scipy` features if the sparse solver is being used
if sparse == True:
from scipy.sparse.linalg import spsolve
from scipy.sparse.linalg import spsolve # noqa: F401

# Prepare the model for analysis
Analysis._prepare_model(self)
Expand Down
6 changes: 2 additions & 4 deletions Pynite/Node3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
"""
from __future__ import annotations # Allows more recent type hints features
# %%
from numpy import array, zeros
from numpy import zeros

from typing import List, Tuple, Dict, Optional,TYPE_CHECKING
if TYPE_CHECKING:

from typing import Dict, List, Tuple, Optional, Any, Literal
from typing import Dict, List, Tuple, Optional

from numpy import float64
from numpy.typing import NDArray

from Pynite.FEModel3D import FEModel3D
from Pynite.LoadCombo import LoadCombo


class Node3D():
Expand Down
5 changes: 2 additions & 3 deletions Pynite/PhysMember.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

from Pynite.Node3D import Node3D
from Pynite.FEModel3D import FEModel3D
import numpy.typing as npt
from numpy import float64
from numpy.typing import NDArray

from numpy import array, dot, linspace, hstack, empty
from numpy import array, linspace, hstack, empty
from numpy.linalg import norm
from math import isclose, acos
from math import isclose

class PhysMember(Member3D):
"""
Expand Down
4 changes: 1 addition & 3 deletions Pynite/Rendering.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from __future__ import annotations # Allows more recent type hints features
from json import load
import warnings
from typing import TYPE_CHECKING, Callable, List, Any
from typing import TYPE_CHECKING, Callable, List

from IPython.display import Image
import numpy as np
import pyvista as pv
import math
Expand Down
2 changes: 0 additions & 2 deletions Pynite/ShearWall.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations # Allows more recent type hints features
from math import isclose
from numpy import average
import io
from typing import TYPE_CHECKING, Literal

from prettytable import PrettyTable
Expand Down
3 changes: 1 addition & 2 deletions Pynite/Spring3D.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# %%
from __future__ import annotations # Allows more recent type hints features
from numpy import zeros, array, add, subtract, matmul, insert, cross, divide
from numpy import zeros, array, matmul, cross, divide
from numpy.linalg import inv
from math import isclose
import Pynite.FixedEndReactions
from Pynite.LoadCombo import LoadCombo
from typing import TYPE_CHECKING

Expand Down
2 changes: 1 addition & 1 deletion Pynite/Tri3D.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations # Allows more recent type hints features
from typing import List, TYPE_CHECKING
from typing import TYPE_CHECKING

from numpy import zeros, array, matmul, cross, add, float64
from numpy.linalg import inv, norm, det
Expand Down
1 change: 0 additions & 1 deletion Pynite/Visualization.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import annotations # Allows more recent type hints features
from json import load
import warnings

from IPython.display import Image
Expand Down
7 changes: 7 additions & 0 deletions Pynite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@

from pip._vendor import pkg_resources

__all__ = (
"FEModel3D",
"ShearWall",
"Pynite",
"__version__",
)

def get_version(package):
package = package.lower()
return next((p.version for p in pkg_resources.working_set if p.project_name.lower() == package), "No match")
Expand Down
1 change: 0 additions & 1 deletion Testing/test_2D_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
3 changes: 0 additions & 3 deletions Testing/test_AISC_PDelta_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
Copyright (c) 2020 D. Craig Brinck, SE; tamalone1
"""

import enum
import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

class Test_AISC_Benchmark(unittest.TestCase):
"""
Expand Down
1 change: 0 additions & 1 deletion Testing/test_TC_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_Visualization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import pytest
from io import BytesIO
from IPython.display import Image
Expand Down
1 change: 0 additions & 1 deletion Testing/test_end_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
2 changes: 1 addition & 1 deletion Testing/test_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

import unittest
from Pynite import FEModel3D, Section
from Pynite import FEModel3D
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_meshes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from Pynite import FEModel3D
from Pynite.Rendering import Renderer
from math import isclose


Expand Down
1 change: 0 additions & 1 deletion Testing/test_reanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_sloped_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_support_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_torsion.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest
from Pynite import FEModel3D
import math
import sys
from io import StringIO

Expand Down
1 change: 0 additions & 1 deletion Testing/test_unstable_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import unittest

from numpy import True_
from Pynite import FEModel3D
import sys
from io import StringIO
Expand Down
2 changes: 0 additions & 2 deletions Testing/x_test_nonlinear.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import unittest
from Pynite import FEModel3D
from Pynite.Section import SteelSection
import math
import sys
from io import StringIO

Expand Down
10 changes: 10 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
target-version = "py310"
extend-exclude = [
"*.ipynb",
]

[lint]
select = [
# https://docs.astral.sh/ruff/rules/unused-import/
"F401",
]