Revert "Added averaging check for API to convert y/n to True/False"

This reverts commit 23c88cee25.
Reverting because this commit caused a circular dependency between
hash_cmds_geometry.py and the UserObject files in cmds_geometry/
这个提交包含在:
nmannall
2024-05-21 14:31:52 +01:00
父节点 98e74c0c7a
当前提交 b893a83632
共有 7 个文件被更改,包括 3 次插入17 次删除

查看文件

@@ -23,7 +23,6 @@ import numpy as np
import gprMax.config as config import gprMax.config as config
from ..cython.geometry_primitives import build_box from ..cython.geometry_primitives import build_box
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry, rotate_2point_object from .cmds_geometry import UserObjectGeometry, rotate_2point_object
@@ -88,7 +87,6 @@ class Box(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averagebox = self.kwargs["averaging"] averagebox = self.kwargs["averaging"]
averagebox = check_averaging(averagebox)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagebox = grid.averagevolumeobjects averagebox = grid.averagevolumeobjects

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_cone from ..cython.geometry_primitives import build_cone
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry from .cmds_geometry import UserObjectGeometry
@@ -62,11 +61,10 @@ class Cone(UserObjectGeometry):
# Check averaging # Check averaging
try: try:
# Try user-specified averaging # Try user-specified averaging
averagecone = self.kwargs["averaging"] averagecylinder = self.kwargs["averaging"]
averagecone = check_averaging(averagecone)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagecone = grid.averagevolumeobjects averagecylinder = grid.averagevolumeobjects
# Check materials have been specified # Check materials have been specified
# Isotropic case # Isotropic case
@@ -112,7 +110,7 @@ class Cone(UserObjectGeometry):
# Isotropic case # Isotropic case
if len(materials) == 1: if len(materials) == 1:
averaging = materials[0].averagable and averagecone averaging = materials[0].averagable and averagecylinder
numID = numIDx = numIDy = numIDz = materials[0].numID numID = numIDx = numIDy = numIDz = materials[0].numID
# Uniaxial anisotropic case # Uniaxial anisotropic case

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_cylinder from ..cython.geometry_primitives import build_cylinder
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry from .cmds_geometry import UserObjectGeometry
@@ -60,7 +59,6 @@ class Cylinder(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averagecylinder = self.kwargs["averaging"] averagecylinder = self.kwargs["averaging"]
averagecylinder = check_averaging(averagecylinder)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagecylinder = grid.averagevolumeobjects averagecylinder = grid.averagevolumeobjects

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_cylindrical_sector from ..cython.geometry_primitives import build_cylindrical_sector
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry from .cmds_geometry import UserObjectGeometry
@@ -75,7 +74,6 @@ class CylindricalSector(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averagecylindricalsector = self.kwargs["averaging"] averagecylindricalsector = self.kwargs["averaging"]
averagecylindricalsector = check_averaging(averagecylindricalsector)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagecylindricalsector = grid.averagevolumeobjects averagecylindricalsector = grid.averagevolumeobjects

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_ellipsoid from ..cython.geometry_primitives import build_ellipsoid
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry from .cmds_geometry import UserObjectGeometry
@@ -61,7 +60,6 @@ class Ellipsoid(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averageellipsoid = self.kwargs["averaging"] averageellipsoid = self.kwargs["averaging"]
averageellipsoid = check_averaging(averageellipsoid)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averageellipsoid = grid.averagevolumeobjects averageellipsoid = grid.averagevolumeobjects

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_sphere from ..cython.geometry_primitives import build_sphere
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry from .cmds_geometry import UserObjectGeometry
@@ -56,7 +55,6 @@ class Sphere(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averagesphere = self.kwargs["averaging"] averagesphere = self.kwargs["averaging"]
averagesphere = check_averaging(averagesphere)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagesphere = grid.averagevolumeobjects averagesphere = grid.averagevolumeobjects

查看文件

@@ -21,7 +21,6 @@ import logging
import numpy as np import numpy as np
from ..cython.geometry_primitives import build_triangle from ..cython.geometry_primitives import build_triangle
from ..hash_cmds_geometry import check_averaging
from ..materials import Material from ..materials import Material
from .cmds_geometry import UserObjectGeometry, rotate_point from .cmds_geometry import UserObjectGeometry, rotate_point
@@ -81,7 +80,6 @@ class Triangle(UserObjectGeometry):
try: try:
# Try user-specified averaging # Try user-specified averaging
averagetriangularprism = self.kwargs["averaging"] averagetriangularprism = self.kwargs["averaging"]
averagetriangularprism = check_averaging(averagetriangularprism)
except KeyError: except KeyError:
# Otherwise go with the grid default # Otherwise go with the grid default
averagetriangularprism = grid.averagevolumeobjects averagetriangularprism = grid.averagevolumeobjects