Skip to content

Commit f122f0f

Browse files
committed
Use hatch to project and ruff as linter
1 parent 10dfc53 commit f122f0f

20 files changed

Lines changed: 73 additions & 88 deletions

notebooks/CompositeThermo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"metadata": {},
165165
"outputs": [],
166166
"source": [
167-
"from nastran.thermo.analysis.steady_state import SteadyStateThermoAnalysisModel, ThermoSubcase\n",
167+
"from nastran.thermo.analysis.steady_state import SteadyStateThermoAnalysisModel\n",
168168
"\n",
169169
"params = {\n",
170170
" 'LGDISP': 1, # uses Large Displacement formulations\n",

notebooks/MetallicThermo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"metadata": {},
145145
"outputs": [],
146146
"source": [
147-
"from nastran.thermo.analysis.steady_state import SteadyStateThermoAnalysisModel, ThermoSubcase\n",
147+
"from nastran.thermo.analysis.steady_state import SteadyStateThermoAnalysisModel\n",
148148
"\n",
149149
"params = {\n",
150150
" 'LGDISP': 1, # uses Large Displacement formulations\n",

pyproject.toml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,43 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "nastran-aeroelasticity"
7+
dynamic = ["version"]
8+
description = "Some usefull routines for aeroelastic analysis with NASTRAN"
9+
readme = "README.md"
10+
license = "MIT"
11+
requires-python = ">=3.7"
12+
authors = [
13+
{ name = "Victor Santos", email = "victorsantos@ufmg.br" },
514
]
6-
build-backend = "setuptools.build_meta"
15+
classifiers = [
16+
"License :: OSI Approved :: MIT License",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3",
19+
]
20+
dependencies = [
21+
"matplotlib>=3.1.3",
22+
"numpy>=1.18.1",
23+
"pandas>=1.3",
24+
"pyNastran>=1.3.2",
25+
]
26+
27+
[project.urls]
28+
"Bug Tracker" = "https://github.com/zuckberj/nastran-aero-flutter/issues"
29+
Homepage = "https://github.com/zuckberj/nastran-aero-flutter"
30+
31+
[tool.hatch.version]
32+
path = "src/nastran/__init__.py"
33+
34+
[tool.hatch.build.targets.wheel]
35+
packages = [
36+
" src/nastran",
37+
]
38+
39+
[tool.hatch.build.targets.sdist]
40+
include = [
41+
"/ src",
42+
]
43+

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cfg

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

src/nastran/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__="0.2.1"

src/nastran/aero/analysis/flutter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
from typing import Dict
3-
from pyNastran.bdf.bdf import BDF, CaseControlDeck
3+
from pyNastran.bdf.bdf import BDF
44

55
from nastran.analysis import AnalysisModel, Subcase
66

src/nastran/aero/superpanels.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
from typing import Any, Dict
33

4-
from numpy.lib.utils import deprecate
54
from nastran.geometry.panels import RectangularPlate
65
from nastran.aero.panels import AeroPanel, AeroPanel1, AeroPanel5
76

src/nastran/analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from abc import ABC, abstractmethod
1+
from abc import ABC
22
from typing import Dict, Type
33
from numpy.lib.utils import deprecate
44

@@ -187,7 +187,7 @@ def _write_global_analysis_cards(self):
187187

188188
def _write_params(self):
189189
# params
190-
if self.params == None:
190+
if self.params is None:
191191
print('WARNING: No PARAMS defined')
192192
else:
193193
for key, param in self.params.items():

src/nastran/post/f06/common.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from pandas.core.frame import DataFrame
21

3-
import pandas as pd
42
import numpy as np
53
import re
64
import calendar
@@ -19,7 +17,7 @@ class F06Page:
1917

2018
def __init__(self, raw_lines=None, meta=None):
2119
self.raw_lines = raw_lines
22-
self.meta = {} if meta == None else meta
20+
self.meta = {} if meta is None else meta
2321
self.parse_page_metadata_header()
2422

2523
def parse_page_metadata_header(self):
@@ -48,8 +46,8 @@ def find_tabular_line_range(lines, shift):
4846
k = len(lines)
4947
j = shift # linha após as labels de dados
5048
while j < k: # primeiro char na linha final da pagina é 1
51-
l = lines[j]
52-
if _check_skip_lines(l) or l.strip() == '':
49+
item = lines[j]
50+
if _check_skip_lines(item) or item.strip() == '':
5351
break
5452
j += 1
5553
return (shift, j)

0 commit comments

Comments
 (0)