Skip to content

Commit

Permalink
Allow for multiple additive server connections
Browse files Browse the repository at this point in the history
  • Loading branch information
pkrull-ansys committed Nov 2, 2023
1 parent 736df54 commit b7ec6ce
Show file tree
Hide file tree
Showing 33 changed files with 1,762 additions and 674 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This code shows how to import PyAdditive and use some basic capabilities:
input = pyadditive.SingleBeadInput(
machine=pyadditive.AdditiveMachine(),
material=additive.get_material("Ti64"),
material=additive.material("Ti64"),
id="bead1",
bead_length=0.001, # meters
)
Expand Down
10 changes: 5 additions & 5 deletions examples/00_additive_single_bead.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@
# ---------------------------------
# Get server connection information using the :meth:`about <Additive.about>` method.

print(additive.about())
additive.about()

###############################################################################
# Select material
# ---------------
# Select a material. You can use the
# :meth:`get_materials_list() <ansys.additive.core.additive.Additive.get_materials_list>`
# :meth:`materials_list() <ansys.additive.core.additive.Additive.materials_list>`
# method to obtain a list of available materials.

print(additive.get_materials_list())
additive.materials_list()

###############################################################################
# You can obtain the parameters for a single material by passing a name
# from the materials list to the
# :meth:`get_material() <ansys.additive.core.additive.Additive.get_material>`
# :meth:`material() <ansys.additive.core.additive.Additive.material>`
# method.

material = additive.get_material("17-4PH")
material = additive.material("17-4PH")

###############################################################################
# Specify machine parameters
Expand Down
8 changes: 4 additions & 4 deletions examples/01_additive_porosity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@
# Select material
# ---------------
# Select a material. You can use the
# :meth:`get_materials_list() <ansys.additive.core.additive.Additive.get_materials_list>`
# :meth:`materials_list() <ansys.additive.core.additive.Additive.materials_list>`
# method to obtain a list of available materials.

print(additive.get_materials_list())
additive.materials_list()

###############################################################################
# You can obtain the parameters for a single material by passing a name
# from the materials list to the
# :meth:`get_material() <ansys.additive.core.additive.Additive.get_material>`
# :meth:`material() <ansys.additive.core.additive.Additive.material>`
# method.

material = additive.get_material("316L")
material = additive.material("316L")

###############################################################################
# Specify machine parameters
Expand Down
8 changes: 4 additions & 4 deletions examples/02_additive_microstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
# Select material
# ---------------
# Select a material. You can use the
# :meth:`get_materials_list() <ansys.additive.core.additive.Additive.get_materials_list>`
# :meth:`materials_list() <ansys.additive.core.additive.Additive.materials_list>`
# method to obtain a list of available materials.

print(additive.get_materials_list())
additive.materials_list()

###############################################################################
# You can obtain the parameters for a single material by passing a name
# from the materials list to the
# :meth:`get_material() <ansys.additive.core.additive.Additive.get_material>`
# :meth:`material() <ansys.additive.core.additive.Additive.material>`
# method.

material = additive.get_material("17-4PH")
material = additive.material("17-4PH")

###############################################################################
# Specify machine parameters
Expand Down
8 changes: 4 additions & 4 deletions examples/03_additive_thermal_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@
# Select material
# ---------------
# Select a material. You can use the
# :meth:`get_materials_list() <ansys.additive.additive.Additive.get_materials_list>`
# :meth:`materials_list() <ansys.additive.additive.Additive.materials_list>`
# method to obtain a list of available materials.

print(additive.get_materials_list())
additive.materials_list()

###############################################################################
# You can obtain the parameters for a single material by passing a name
# from the materials list to the
# :meth:`get_material() <ansys.additive.additive.Additive.get_material>`
# :meth:`material() <ansys.additive.additive.Additive.material>`
# method.

material = additive.get_material("17-4PH")
material = additive.material("17-4PH")

###############################################################################
# Specify machine parameters
Expand Down
2 changes: 1 addition & 1 deletion examples/11_advanced_parametric_study.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# and print a list of available materials prior to selecting one.

additive = Additive()
print(additive.get_materials_list())
additive.materials_list()
material = "IN718"

###############################################################################
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ tests = [
# Test specific dependencies
"pytest==7.4.2",
"pytest-cov==4.0.0",
"callee==0.3.1",
]

doc = [
Expand Down Expand Up @@ -122,7 +121,7 @@ show_missing = true

[tool.pytest.ini_options]
minversion = "7.1"
addopts = "-ra --cov=ansys.additive.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv --cov-fail-under 90"
addopts = "-ra --cov=ansys.additive.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv --cov-fail-under 97"
testpaths = ["tests"]
filterwarnings = ["ignore:::.*protoc_gen_swagger*"]

Expand Down
4 changes: 1 addition & 3 deletions src/ansys/additive/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@

__version__ = importlib_metadata.version(__name__.replace(".", "-"))

APP_NAME = "ansys-pyadditive"
APP_NAME = "pyadditive"
COMPANY_NAME = "Ansys Inc"


# Setup data directory
USER_DATA_PATH = platformdirs.user_data_dir(APP_NAME, COMPANY_NAME)
if not os.path.exists(USER_DATA_PATH): # pragma: no cover
Expand All @@ -59,7 +58,6 @@
MicrostructureSummary,
)
from ansys.additive.core.porosity import PorosityInput, PorositySummary
from ansys.additive.core.server_connection.server_utils import find_open_port, launch_server
from ansys.additive.core.simulation import SimulationError, SimulationStatus, SimulationType
from ansys.additive.core.single_bead import (
MeltPool,
Expand Down
Loading

0 comments on commit b7ec6ce

Please sign in to comment.