Skip to content

Commit

Permalink
Move 'import lxml' to third-party block of imports (openmc-dev#2803)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano authored and church89 committed Jul 18, 2024
1 parent b6a2800 commit a257ca4
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion openmc/cell.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from collections.abc import Iterable
from math import cos, sin, pi
from numbers import Real
import lxml.etree as ET

import lxml.etree as ET
import numpy as np
from uncertainties import UFloat

Expand Down
2 changes: 1 addition & 1 deletion openmc/data/library.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import lxml.etree as ET
import pathlib

import h5py
import lxml.etree as ET

import openmc
from openmc._xml import clean_indentation, reorder_attributes
Expand Down
2 changes: 1 addition & 1 deletion openmc/deplete/nuclide.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from collections import namedtuple, defaultdict
from warnings import warn
from numbers import Real
import lxml.etree as ET

import lxml.etree as ET
import numpy as np

from openmc.checkvalue import check_type
Expand Down
1 change: 1 addition & 0 deletions openmc/element.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re

import lxml.etree as ET

import openmc.checkvalue as cv
Expand Down
2 changes: 1 addition & 1 deletion openmc/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import hashlib
from itertools import product
from numbers import Real, Integral
import lxml.etree as ET
import warnings

import lxml.etree as ET
import numpy as np
import pandas as pd

Expand Down
1 change: 1 addition & 0 deletions openmc/filter_expansion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from numbers import Integral, Real

import lxml.etree as ET

import openmc.checkvalue as cv
Expand Down
2 changes: 1 addition & 1 deletion openmc/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from math import sqrt, floor
from numbers import Real
import types
import lxml.etree as ET

import lxml.etree as ET
import numpy as np

import openmc
Expand Down
2 changes: 1 addition & 1 deletion openmc/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import typing # imported separately as py3.8 requires typing.Iterable
import warnings
from typing import Optional, List, Union, Dict
import lxml.etree as ET

import lxml.etree as ET
import numpy as np
import h5py

Expand Down
2 changes: 1 addition & 1 deletion openmc/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from numbers import Integral
from tempfile import NamedTemporaryFile
import warnings
import lxml.etree as ET
from typing import Optional, Dict

import h5py
import lxml.etree as ET

import openmc
import openmc._xml as xml
Expand Down
2 changes: 1 addition & 1 deletion openmc/plots.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from collections.abc import Iterable, Mapping
from numbers import Integral, Real
from pathlib import Path
import lxml.etree as ET
from typing import Optional

import h5py
import lxml.etree as ET
import numpy as np

import openmc
Expand Down
3 changes: 1 addition & 2 deletions openmc/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
from collections.abc import Iterable, Mapping, MutableSequence
from enum import Enum
import itertools
Expand All @@ -7,11 +6,11 @@
from pathlib import Path
import typing # required to prevent typing.Union namespace overwriting Union
from typing import Optional

import lxml.etree as ET

import openmc.checkvalue as cv
from openmc.stats.multivariate import MeshSpatial

from . import (RegularMesh, SourceBase, MeshSource, IndependentSource,
VolumeCalculation, WeightWindows, WeightWindowGenerator)
from ._xml import clean_indentation, get_text, reorder_attributes
Expand Down
2 changes: 1 addition & 1 deletion openmc/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import typing # imported separately as py3.8 requires typing.Iterable
# also required to prevent typing.Union namespace overwriting Union
from typing import Optional, Sequence
import lxml.etree as ET

import lxml.etree as ET
import numpy as np
import h5py

Expand Down
2 changes: 1 addition & 1 deletion openmc/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from copy import deepcopy
import math
from numbers import Real
import lxml.etree as ET
from warnings import warn, catch_warnings, simplefilter

import lxml.etree as ET
import numpy as np

from .checkvalue import check_type, check_value, check_length, check_greater_than
Expand Down
1 change: 1 addition & 0 deletions openmc/tally_derivative.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from numbers import Integral

import lxml.etree as ET

import openmc.checkvalue as cv
Expand Down
1 change: 1 addition & 0 deletions openmc/trigger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Iterable
from numbers import Real

import lxml.etree as ET

import openmc.checkvalue as cv
Expand Down
6 changes: 1 addition & 5 deletions openmc/universe.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import math
import typing
from abc import ABC, abstractmethod
from collections.abc import Iterable
from copy import deepcopy
from numbers import Integral, Real
from pathlib import Path
from tempfile import TemporaryDirectory
import lxml.etree as ET
import warnings

import h5py
import lxml.etree as ET
import numpy as np

import openmc
import openmc.checkvalue as cv

from ._xml import get_text
from .checkvalue import check_type, check_value
from .mixin import IDManagerMixin
from .plots import _SVG_COLORS
from .surface import _BOUNDARY_TYPES


Expand Down
4 changes: 2 additions & 2 deletions openmc/volume.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from collections.abc import Iterable, Mapping
from numbers import Real, Integral
import lxml.etree as ET
import warnings

import h5py
import lxml.etree as ET
import numpy as np
import pandas as pd
import h5py
from uncertainties import ufloat

import openmc
Expand Down
1 change: 0 additions & 1 deletion openmc/weight_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from openmc.mesh import MeshBase, RectilinearMesh, CylindricalMesh, SphericalMesh, UnstructuredMesh
import openmc.checkvalue as cv
from openmc.checkvalue import PathLike

from ._xml import get_text, clean_indentation
from .mixin import IDManagerMixin

Expand Down
2 changes: 0 additions & 2 deletions tests/unit_tests/test_cell.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import lxml.etree as ET

import numpy as np
from uncertainties import ufloat
import openmc
import pytest


from tests.unit_tests import assert_unbounded
from openmc.data import atomic_mass, AVOGADRO

Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/test_deplete_nuclide.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Tests for the openmc.deplete.Nuclide class."""

import lxml.etree as ET
import copy

import lxml.etree as ET
import numpy as np
import pytest
from openmc.deplete import nuclide
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_lattice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from math import sqrt
import lxml.etree as ET

import lxml.etree as ET
import openmc
import pytest

Expand Down
1 change: 0 additions & 1 deletion tests/unit_tests/test_universe.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import lxml.etree as ET

import numpy as np
import openmc
import pytest
Expand Down

0 comments on commit a257ca4

Please sign in to comment.