Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing pymapdl-reader dependency on the mesh module #1299

Merged
merged 40 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
7a953e1
Replacing default value for chunk size.
germa89 Jul 25, 2022
d773c97
First attemp
germa89 Jul 25, 2022
dc45712
Merge branch 'main' into feat/replacing-mesh
germa89 Jul 25, 2022
3279887
Merge branch 'main' into feat/replacing-mesh
germa89 Jul 27, 2022
9662cae
Initial commit.
germa89 Jul 27, 2022
1d42302
Adding dpf to test requirements.
germa89 Aug 23, 2022
c3784e6
Missing import
germa89 Aug 23, 2022
18e1006
Renaming class.
germa89 Aug 24, 2022
2f43419
Merge branch 'main' into feat/replacing-mesh
germa89 Aug 24, 2022
7a08c35
Moving contact solve fixture to conftest
germa89 Aug 24, 2022
4aa9e8a
fixing some coverage.
germa89 Aug 24, 2022
b3f4870
Adding unit tests
germa89 Aug 24, 2022
37d5887
removing extra file
germa89 Aug 24, 2022
f330e77
Removing dpf
germa89 Aug 24, 2022
f459e0d
Fixing tests
germa89 Aug 24, 2022
3f2a6a5
Adding test to not implemented methods.
germa89 Aug 24, 2022
cc01ec2
Removing needs from unit tests in CICD
germa89 Aug 24, 2022
af559b3
Merge branch 'ci/make-unit-test-independent-' into feat/replacing-mesh
germa89 Aug 24, 2022
da50d25
Fixing unit tests and removing overwritting of ``node_angles``
germa89 Aug 24, 2022
9b1f1a7
Undoing the node_angles
germa89 Aug 24, 2022
c1e26da
Merging both classes and changing folder name.
germa89 Aug 25, 2022
2ab7a9b
emptying the mesh file.
germa89 Aug 25, 2022
b8e44cb
emptying the mesh file.
germa89 Aug 25, 2022
3415677
Big refactoring.
germa89 Aug 25, 2022
57235a0
Adding unit tests.
germa89 Aug 25, 2022
06c2222
Fixing tests
germa89 Aug 25, 2022
35e25ed
Improving tests.
germa89 Aug 25, 2022
e4a0194
Improving coverage
germa89 Aug 25, 2022
69f246e
Calling parse_vtk from mesh folder (centralizing)
germa89 Aug 25, 2022
a925e29
Adding mesh.py
germa89 Aug 25, 2022
4856654
Removing duplicated function
germa89 Aug 25, 2022
d9f9efc
Trying to fix the docs.
germa89 Aug 26, 2022
dccc09f
Fixing tech demo example
germa89 Aug 29, 2022
70fe5aa
Merge branch 'main' into feat/replacing-mesh
germa89 Aug 29, 2022
4db3b14
Fixing mesh plotting in tech demo
germa89 Aug 29, 2022
8ce0f94
Ading more clean options to make file
germa89 Aug 29, 2022
a6d8fbb
Reset cache
germa89 Aug 29, 2022
fd5efa2
Merge branch 'main' into feat/replacing-mesh
germa89 Aug 29, 2022
14287b7
fixing cache.
germa89 Aug 29, 2022
983eca9
Removing useless if condition.
germa89 Aug 30, 2022
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
2 changes: 2 additions & 0 deletions requirements/requirements_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ pytest-cov==3.0.0
pyvista==0.35.2
pyansys-tools-report==0.2.2
vtk==9.0.3
ansys-dpf-core>=0.4.0
ansys-dpf-post>=0.2.0
5 changes: 4 additions & 1 deletion src/ansys/mapdl/core/mapdl_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ def download(
self,
files,
target_dir=None,
chunk_size=DEFAULT_CHUNKSIZE,
chunk_size=None,
progress_bar=None,
recursive=False,
): # pragma: no cover
Expand Down Expand Up @@ -1638,6 +1638,9 @@ def download(
>>> mapdl.download_project()

"""
if chunk_size is None:
chunk_size = DEFAULT_CHUNKSIZE

if chunk_size > 4 * 1024 * 1024: # 4MB
raise ValueError(
f"Chunk sizes bigger than 4 MB can generate unstable behaviour in PyMAPDL. "
Expand Down
16 changes: 14 additions & 2 deletions src/ansys/mapdl/core/mesh_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
import weakref

from ansys.api.mapdl.v0 import ansys_kernel_pb2 as anskernel
from ansys.mapdl.reader.mesh import Mesh

from ansys.mapdl.core.reader import HAS_DPF_CORE

if HAS_DPF_CORE:
from ansys.mapdl.core.reader import DPFMapdlMesh as Mesh
else:
try:
from ansys.mapdl.reader.mesh import Mesh

HAS_PYMAPDL_READER = True
except ModuleNotFoundError:
HAS_PYMAPDL_READER = False

import numpy as np

from ansys.mapdl.core.common_grpc import DEFAULT_CHUNKSIZE, parse_chunks
Expand All @@ -19,7 +31,7 @@ class MeshGrpc(Mesh):

def __init__(self, mapdl):
"""Initialize grpc geometry data"""
super().__init__()
super().__init__(mapdl)
if not isinstance(mapdl, MapdlGrpc): # pragma: no cover
raise TypeError("Must be initialized using MapdlGrpc class")
self._mapdl_weakref = weakref.ref(mapdl)
Expand Down
8 changes: 8 additions & 0 deletions src/ansys/mapdl/core/reader/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
try:
from ansys.dpf.core import Model

HAS_DPF_CORE = True
except ModuleNotFoundError:
HAS_DPF_CORE = False

from .mesh import DPFMapdlMesh
Loading