Skip to content

Commit

Permalink
fix: typo in pyproject.toml + reverting pre-commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie committed Nov 27, 2023
1 parent 7539978 commit 869928b
Show file tree
Hide file tree
Showing 66 changed files with 443 additions and 215 deletions.
10 changes: 7 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
"""Sphinx documentation configuration file."""
from datetime import datetime
import os
import warnings
from datetime import datetime

from ansys_sphinx_theme import (
ansys_favicon,
get_version_match,
pyansys_logo_black,
pyansys_logo_white,
)
import numpy as np
import pyvista
from ansys_sphinx_theme import (ansys_favicon, get_version_match,
pyansys_logo_black, pyansys_logo_white)
from sphinx.application import Sphinx
from sphinx_gallery.sorting import FileNameSortKey

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
This script convert the file in `gmsh` format to ANSYS `CDB` format.
"""

import pyvista as pv
from ansys.mapdl.reader import save_as_archive
import pyvista as pv

filename = "from_gmsh.msh"
mesh = pv.read_meshio(filename)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Script to calculate the first natural frequecy of a rotor for a given set of properties
import click

# Import packages
import numpy as np

Expand Down
15 changes: 12 additions & 3 deletions doc/source/examples/extended_examples/gui/gui_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

from PySide6 import QtWidgets
from PySide6.QtCore import Qt
from PySide6.QtWidgets import (QApplication, QGridLayout, QLabel, QLineEdit,
QMainWindow, QMessageBox, QPushButton, QSlider,
QVBoxLayout, QWidget)
from PySide6.QtWidgets import (
QApplication,
QGridLayout,
QLabel,
QLineEdit,
QMainWindow,
QMessageBox,
QPushButton,
QSlider,
QVBoxLayout,
QWidget,
)
from pyvistaqt import QtInteractor

from ansys.mapdl.core import Mapdl, MapdlTheme, launch_mapdl
Expand Down
2 changes: 1 addition & 1 deletion doc/validate_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Removes invalid PNGs (probably GIF)
"""
import os
from glob import glob
import os

from PIL import Image

Expand Down
1 change: 1 addition & 0 deletions examples/00-mapdl-examples/2d_pressure_vessel.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"""

import matplotlib.pyplot as plt

###############################################################################
# Launch MAPDL
# ~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion examples/00-mapdl-examples/3d_notch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
First, start MAPDL as a service and disable all but error messages.
"""
from matplotlib import pyplot as plt

# sphinx_gallery_thumbnail_number = 3
import numpy as np
import pyvista as pv
from matplotlib import pyplot as plt

from ansys.mapdl.core import launch_mapdl

Expand Down
2 changes: 1 addition & 1 deletion examples/00-mapdl-examples/composite_dcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
import os
import tempfile

from ansys.dpf import core as dpf
import matplotlib.pyplot as plt
import numpy as np
import pyvista as pv
from ansys.dpf import core as dpf

from ansys.mapdl import core as pymapdl

Expand Down
2 changes: 1 addition & 1 deletion examples/00-mapdl-examples/pyvista_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import os
import tempfile

import pyvista as pv
from ansys.mapdl.reader import save_as_archive
import pyvista as pv

from ansys.mapdl.core import launch_mapdl

Expand Down
1 change: 1 addition & 0 deletions examples/02-tips-n-tricks/05-explore_mapdl_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"""

from ansys.mapdl.core import launch_mapdl

# Start MAPDL as a service and disable all but error messages.
from ansys.mapdl.core.examples import vmfiles

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ tests = [
"ansys-dpf-core==0.10.0",
"autopep8==2.0.4",
"matplotlib==3.8.2",
"scipy==1.11.3,
"scipy==1.11.3",
"pandas==2.1.3",
"pyiges[full]==0.3.1",
"pytest==7.4.3",
Expand Down
14 changes: 8 additions & 6 deletions src/ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@
__version__ = importlib_metadata.version(__name__.replace(".", "-"))

try:
from ansys.tools.path.path import (change_default_ansys_path, find_ansys,
get_ansys_path,
get_available_ansys_installations,
save_ansys_path)
from ansys.tools.path.path import (
change_default_ansys_path,
find_ansys,
get_ansys_path,
get_available_ansys_installations,
save_ansys_path,
)
except:
# We don't really use these imports in the library. They are here for
# convenience.
Expand All @@ -89,8 +92,7 @@

# override default launcher when on pyansys.com
if "ANSJUPHUB_VER" in os.environ: # pragma: no cover
from ansys.mapdl.core.jupyter import \
launch_mapdl_on_cluster as launch_mapdl
from ansys.mapdl.core.jupyter import launch_mapdl_on_cluster as launch_mapdl
else:
from ansys.mapdl.core.launcher import launch_mapdl

Expand Down
10 changes: 8 additions & 2 deletions src/ansys/mapdl/core/_commands/apdl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
from . import (abbreviations, array_param, macro_files, matrix_op,
parameter_definition, process_controls)
from . import (
abbreviations,
array_param,
macro_files,
matrix_op,
parameter_definition,
process_controls,
)
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/graphics_/style.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
from typing import Optional, Union
import warnings

from ansys.mapdl.core.mapdl_types import MapdlInt

Expand Down
19 changes: 16 additions & 3 deletions src/ansys/mapdl/core/_commands/post1_/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
from . import (animation, controls, element_table, failure_criteria, listing,
load_case, magnetics_calc, path_operations, results, setup,
special, status, surface_operations, trace_points)
from . import (
animation,
controls,
element_table,
failure_criteria,
listing,
load_case,
magnetics_calc,
path_operations,
results,
setup,
special,
status,
surface_operations,
trace_points,
)
33 changes: 27 additions & 6 deletions src/ansys/mapdl/core/_commands/preproc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
from . import (areas, artificially_matched_layers, booleans,
constraint_equations, coupled_dof, database, digitizing,
element_type, elements, explicit_dynamics, hard_points,
keypoints, lines, material_data_tables, materials, meshing,
morphing, nodes, primitives, real_constants, sections,
special_purpose, status, superelements, volumes)
from . import (
areas,
artificially_matched_layers,
booleans,
constraint_equations,
coupled_dof,
database,
digitizing,
element_type,
elements,
explicit_dynamics,
hard_points,
keypoints,
lines,
material_data_tables,
materials,
meshing,
morphing,
nodes,
primitives,
real_constants,
sections,
special_purpose,
status,
superelements,
volumes,
)
46 changes: 33 additions & 13 deletions src/ansys/mapdl/core/_commands/solution/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
from . import (all_others, analysis_options, birth_and_death, dynamic_options,
fe_body_loads, fe_constraints, fe_forces, fe_surface_loads,
gap_conditions, inertia, load_step_operations,
load_step_options, master_dof, miscellaneous_loads,
multi_field_solver_convergence_controls,
multi_field_solver_definition_commands,
multi_field_solver_global_controls,
multi_field_solver_interface_mapping,
multi_field_solver_load_transfer,
multi_field_solver_time_controls, nonlinear_options, ocean,
radiosity, rezoning, solid_body_loads, solid_constraints,
solid_forces, solid_surface_loads, solution_status,
spectrum_options, twod_to_3d_analysis)
from . import (
all_others,
analysis_options,
birth_and_death,
dynamic_options,
fe_body_loads,
fe_constraints,
fe_forces,
fe_surface_loads,
gap_conditions,
inertia,
load_step_operations,
load_step_options,
master_dof,
miscellaneous_loads,
multi_field_solver_convergence_controls,
multi_field_solver_definition_commands,
multi_field_solver_global_controls,
multi_field_solver_interface_mapping,
multi_field_solver_load_transfer,
multi_field_solver_time_controls,
nonlinear_options,
ocean,
radiosity,
rezoning,
solid_body_loads,
solid_constraints,
solid_forces,
solid_surface_loads,
solution_status,
spectrum_options,
twod_to_3d_analysis,
)
26 changes: 22 additions & 4 deletions src/ansys/mapdl/core/commands.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
import re
from functools import wraps
import re

import numpy as np

from ._commands import (apdl, aux2_, aux3_, aux12_, aux15_, conn, database,
display_, graphics_, hidden, inq_func, map_cmd, misc,
post1_, post26_, preproc, reduced, session, solution)
from ._commands import (
apdl,
aux2_,
aux3_,
aux12_,
aux15_,
conn,
database,
display_,
graphics_,
hidden,
inq_func,
map_cmd,
misc,
post1_,
post26_,
preproc,
reduced,
session,
solution,
)

# compiled regular expressions used for parsing tablular outputs
REG_LETTERS = re.compile(r"[a-df-zA-DF-Z]+") # all except E or e
Expand Down
16 changes: 12 additions & 4 deletions src/ansys/mapdl/core/component.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
"""Component related module"""

from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Literal,
Optional,
Tuple,
Union,
get_args,
)
import warnings
import weakref
from typing import (TYPE_CHECKING, Any, Dict, List, Literal, Optional, Tuple,
Union, get_args)

import numpy as np
from numpy.typing import NDArray

from ansys.mapdl.core import Mapdl
from ansys.mapdl.core.errors import (ComponentDoesNotExits,
ComponentIsNotSelected)
from ansys.mapdl.core.errors import ComponentDoesNotExits, ComponentIsNotSelected

if TYPE_CHECKING: # pragma: no cover
import logging
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/convert.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from logging import Logger, StreamHandler
import os
import re
from logging import Logger, StreamHandler
from warnings import warn

from ansys.mapdl.core import __version__
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""The mapdl database module, allowing the access to the MAPDL database from Python."""

from .database import MapdlDb # noqa: F401
from .database import MINIMUM_MAPDL_VERSION, DBDef, check_mapdl_db_is_alive
from .database import MapdlDb # noqa: F401
8 changes: 4 additions & 4 deletions src/ansys/mapdl/core/database/database.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""Contains the MapdlDb classes, allowing the access to MAPDL DB from Python."""
import os
import time
import weakref
from enum import Enum
from functools import wraps
import os
import time
from warnings import warn
import weakref

import grpc
from ansys.api.mapdl.v0 import mapdl_db_pb2_grpc
from ansys.tools.versioning import server_meets_version
import grpc

from ansys.mapdl.core.errors import MapdlConnectionError

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/database/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"""
import weakref

import numpy as np
from ansys.api.mapdl.v0 import ansys_kernel_pb2 as anskernel
from ansys.api.mapdl.v0 import mapdl_db_pb2
import numpy as np
from numpy.lib import recfunctions

from ansys.mapdl.core.errors import MapdlRuntimeError
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/errors.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""PyMAPDL specific errors"""

from functools import wraps
import signal
import threading
from functools import wraps

from grpc._channel import _InactiveRpcError, _MultiThreadedRendezvous

Expand Down
Loading

0 comments on commit 869928b

Please sign in to comment.