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

fix: enable isort and apply it to the library #1777

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
5 changes: 2 additions & 3 deletions .ci/build_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# Input can be one of ["any", "win", "manylinux1", "manylinux_2_17"]

import argparse
import subprocess
import os
import sys
import shutil
import subprocess
import sys
import tempfile


supported_platforms = {
"any": "any",
"win": "win_amd64",
Expand Down
8 changes: 4 additions & 4 deletions .ci/code_generation.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# import subprocess

from ansys.dpf import core
from ansys.dpf.core.operators import build
import os
import glob
import os
from pathlib import Path
import time
import shutil
import time

from ansys.dpf import core
from ansys.dpf.core.operators import build

core.set_default_server_context(core.AvailableServerContexts.premium)

Expand Down
3 changes: 1 addition & 2 deletions .ci/run_examples.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import os
import glob
import os
import pathlib
import subprocess
import sys

import ansys.dpf.core as dpf
from ansys.dpf.core.examples import get_example_required_minimum_dpf_version


os.environ["PYVISTA_OFF_SCREEN"] = "true"
os.environ["MPLBACKEND"] = "Agg"

Expand Down
5 changes: 3 additions & 2 deletions .ci/run_non_regression_examples.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import glob
from ansys.dpf import core
import os
import pathlib
import subprocess
import sys

from ansys.dpf import core

os.environ["PYVISTA_OFF_SCREEN"] = "true"
os.environ["MPLBACKEND"] = "Agg"

Expand Down
3 changes: 1 addition & 2 deletions .ci/update_dpf_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
or the repo defined by the environment variable "ANSYSDPFCORE_ROOT" if it exists.
"""

import os
import glob
import os
import pathlib
import platform
import shutil
import zipfile


grpc_path_key = "DPFDV_ROOT"
gate_path_key = "ANSYSDPFPYGATE_ROOT"
core_path = pathlib.Path(__file__).parent.parent.resolve()
Expand Down
4 changes: 1 addition & 3 deletions examples/00-basic/05-use_local_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@

# Import necessary modules
from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create a model object to establish a connection with an
Expand Down
1 change: 1 addition & 0 deletions examples/00-basic/11-server_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"""

import os

from ansys.dpf import core as dpf

###############################################################################
Expand Down
3 changes: 1 addition & 2 deletions examples/01-transient_analyses/00-basic_transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
import numpy as np

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Download the transient result example. This example is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
import matplotlib.pyplot as plt

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create the model and display the state of the result. This transient result
Expand Down
3 changes: 1 addition & 2 deletions examples/02-modal_analyses/01-plot_and_animate_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"""

from ansys.dpf import core as dpf
from ansys.dpf.core import animation
from ansys.dpf.core import examples
from ansys.dpf.core import animation, examples

###############################################################################
# Retrieve mode shapes
Expand Down
4 changes: 1 addition & 3 deletions examples/03-harmonic_analyses/00-multi_harmonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
import matplotlib.pyplot as pyplot

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf.core import examples, operators as ops

###############################################################################
# Begin by downloading the example harmonic result. This result is
Expand Down
1 change: 0 additions & 1 deletion examples/03-harmonic_analyses/01-modal_superposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


###############################################################################
# Create data sources
# ~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 1 addition & 2 deletions examples/04-advanced/00-multistage_advanced_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"""

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create the model and display the state of the result.
Expand Down
1 change: 0 additions & 1 deletion examples/04-advanced/01-solve_harmonic_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import operators as ops


###############################################################################
# Create 2D (x,y) matrix fields for inertia, damping, and stiffness.

Expand Down
4 changes: 1 addition & 3 deletions examples/04-advanced/02-volume_averaged_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"""

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create a model targeting a given result file
Expand Down
4 changes: 1 addition & 3 deletions examples/04-advanced/03-exchange_data_between_servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"""

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create two servers
Expand Down
1 change: 0 additions & 1 deletion examples/04-advanced/04-extrapolation_stress_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


###############################################################################
# Get the data source's analysis of integration points and analysis reference
datafile = examples.download_extrapolation_3d_result()
Expand Down
1 change: 0 additions & 1 deletion examples/04-advanced/05-extrapolation_strain_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


###############################################################################
# Get the data source's analyse of integration points and data source's analyse reference
datafile = examples.download_extrapolation_2d_result()
Expand Down
4 changes: 1 addition & 3 deletions examples/04-advanced/06-stress_gradient_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@
import matplotlib.pyplot as plt

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops
from ansys.dpf.core.plotter import DpfPlotter


###############################################################################
# Open an example and print out the ``Model`` object. The
# :class:`Model <ansys.dpf.core.model.Model>` class helps to organize access
Expand Down
1 change: 0 additions & 1 deletion examples/04-advanced/07-load_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
# Import DPF-Core:
from ansys.dpf import core as dpf


server = dpf.global_server()

###############################################################################
Expand Down
3 changes: 2 additions & 1 deletion examples/04-advanced/11-cycles_to_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@
The higher the stress result, the lower the number of cycles to failure.
"""

import numpy as np

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
import numpy as np

###############################################################################
# The first step is to generate a simple model with high stress
Expand Down
1 change: 0 additions & 1 deletion examples/04-advanced/14-incremental_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


#######################################################################################
# Retrieve an example to instantiate a DataSources object
path = examples.download_transient_result()
Expand Down
3 changes: 1 addition & 2 deletions examples/05-file-IO/00-hdf5_double_float_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
import os

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create the model and get the stresses, displacements, and mesh.
Expand Down
3 changes: 1 addition & 2 deletions examples/05-file-IO/01-reduced_matrices_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
# temporary directory.

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Create the operator and connect data sources.
Expand Down
1 change: 0 additions & 1 deletion examples/05-file-IO/04-basic-load-file.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


model = dpf.Model(examples.find_simple_bar())
mesh = model.metadata.meshed_region

Expand Down
1 change: 0 additions & 1 deletion examples/06-plotting/00-basic_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


# Plot the bare mesh of a model
model = dpf.Model(examples.find_multishells_rst())
model.plot(color="w", show_edges=True, title="Model", text="Model plot")
Expand Down
4 changes: 1 addition & 3 deletions examples/06-plotting/04-plot_on_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@
import matplotlib.pyplot as plt

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops
from ansys.dpf.core.plotter import DpfPlotter


###############################################################################
# Plot path
# ~~~~~~~~~
Expand Down
1 change: 0 additions & 1 deletion examples/06-plotting/05-plot_on_warped_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


# Get and show the initial model
model = dpf.Model(examples.find_multishells_rst())
print(model)
Expand Down
1 change: 0 additions & 1 deletion examples/06-plotting/06-animate_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from ansys.dpf import core as dpf
from ansys.dpf.core import examples


# Load the model
model = dpf.Model(examples.find_msup_transient())
print(model)
Expand Down
8 changes: 3 additions & 5 deletions examples/06-plotting/07-plot_on_geometries.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@
# ~~~~~~~~~~~~~~~~~~~~~~
# Import modules and set context as Premium.

import numpy as np
import matplotlib.pyplot as plt
import numpy as np

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops
from ansys.dpf.core.fields_factory import field_from_array
from ansys.dpf.core.geometry import Line, Plane, Points
from ansys.dpf.core.plotter import DpfPlotter
from ansys.dpf.core.fields_factory import field_from_array


###############################################################################
# Load model from examples and print information:
Expand Down
4 changes: 2 additions & 2 deletions examples/07-distributed-post/00-distributed_total_disp.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
# Import the ``dpf-core`` module and its examples files.

import os

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Configure the servers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
# Import the ``dpf-core`` module and its examples files.

import os

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Configure the servers.
Expand Down
5 changes: 2 additions & 3 deletions examples/07-distributed-post/02-distributed-msup_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@
# Import the ``dpf-core`` module and its examples files.

import os
from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf import core as dpf
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Configure the servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@
# Import the ``dpf-core`` module and its examples files.

import os
from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf import core as dpf
from ansys.dpf.core import examples, operators as ops

###############################################################################
# Configure the servers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
# Import dpf module and its examples files

from ansys.dpf import core as dpf
from ansys.dpf.core import examples
from ansys.dpf.core import operators as ops

from ansys.dpf.core import examples, operators as ops

###############################################################################
# Configure the servers
Expand Down
Loading
Loading