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

Protecting from a horrible bug that allowed scripts to redefine #19

Merged
merged 1 commit into from
Jul 27, 2020
Merged
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
4 changes: 2 additions & 2 deletions src/Pybind11Wraps/CXXTypes/CXXTypesMOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def pyinit(self,
# def __repr__(self):
# return

first = PYB11readonly(doc="first value")
second = PYB11readonly(doc="second value")
first = PYB11readonly(doc="first value", returnpolicy="copy")
second = PYB11readonly(doc="second value", returnpolicy="copy")

# std::pair
pair_double_string = PYB11TemplateClass(pair, template_parameters=("double", "std::string"))
Expand Down
4 changes: 2 additions & 2 deletions src/Pybind11Wraps/DataBase/DataBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ def solidNodeLists(self):

#...........................................................................
# Attributes
nDim = PYB11readonly(static=True)
isRZ = PYB11readonly(static=True)
nDim = PYB11readonly(static=True, returnpolicy="copy")
isRZ = PYB11readonly(static=True, returnpolicy="copy")

#...........................................................................
# Properties
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/FifthRankTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class FifthRankTensor:
"Spheral fifth rank tensor (%(ndim)sx%(ndim)sx%(ndim)sx%(ndim)s) class"

# Static attributes
nrank = PYB11readonly(static=True, doc="Rank of the tensor")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
nrank = PYB11readonly(static=True, doc="Rank of the tensor", returnpolicy="copy")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions", returnpolicy="copy")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="The zero value equivalent", returnpolicy="copy")

# Constructors
def pyinit0(self):
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/FourthRankTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class FourthRankTensor:
"Spheral fourth rank tensor (%(ndim)sx%(ndim)sx%(ndim)sx%(ndim)s) class"

# Static attributes
nrank = PYB11readonly(static=True, doc="Rank of the tensor")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
nrank = PYB11readonly(static=True, doc="Rank of the tensor", returnpolicy="copy")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions", returnpolicy="copy")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="The zero value equivalent", returnpolicy="copy")

# Constructors
def pyinit0(self):
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/SymTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class SymTensor:
"Spheral geometric symmetric tensor (rank 2: %(ndim)sx%(ndim)s) class"

# Static attributes
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
one = PYB11readonly(static=True, doc="The unit value equivalent")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions", returnpolicy="copy")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="The zero value equivalent", returnpolicy="copy")
one = PYB11readonly(static=True, doc="The unit value equivalent", returnpolicy="copy")

# Constructors
def pyinit0(self):
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/Tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class Tensor:
"Spheral geometric tensor (rank 2: %(ndim)sx%(ndim)s) class"

# Static attributes
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
one = PYB11readonly(static=True, doc="The unit value equivalent")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions", returnpolicy="copy")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="The zero value equivalent", returnpolicy="copy")
one = PYB11readonly(static=True, doc="The unit value equivalent", returnpolicy="copy")

# Constructors
def pyinit0(self):
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/ThirdRankTensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class ThirdRankTensor:
"Spheral third rank tensor (%(ndim)sx%(ndim)sx%(ndim)s) class"

# Static attributes
nrank = PYB11readonly(static=True, doc="Rank of the tensor")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
nrank = PYB11readonly(static=True, doc="Rank of the tensor", returnpolicy="copy")
nDimensions = PYB11readonly(static=True, doc="Number of dimensions", returnpolicy="copy")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="The zero value equivalent", returnpolicy="copy")

# Constructors
def pyinit0(self):
Expand Down
8 changes: 4 additions & 4 deletions src/Pybind11Wraps/Geometry/Vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class Vector:
"Spheral Geometric Vector class"

# Static attributes
nDimensions = PYB11readonly(static=True, doc="Number of dimensions")
numElements = PYB11readonly(static=True, doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, doc="The zero value equivalent")
one = PYB11readonly(static=True, doc="The unit value equivalent")
nDimensions = PYB11readonly(static=True, returnpolicy="copy", doc="Number of dimensions")
numElements = PYB11readonly(static=True, returnpolicy="copy", doc="Number of elements stored in the type")
zero = PYB11readonly(static=True, returnpolicy="copy", doc="The zero value equivalent")
one = PYB11readonly(static=True, returnpolicy="copy", doc="The unit value equivalent")

# Constructors
def pyinit0(self):
Expand Down
102 changes: 51 additions & 51 deletions src/Pybind11Wraps/Hydro/HydroMOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,54 @@
#-------------------------------------------------------------------------------
class HydroFieldNames:

mass = PYB11readonly(static=True)
position = PYB11readonly(static=True)
velocity = PYB11readonly(static=True)
H = PYB11readonly(static=True)
work = PYB11readonly(static=True)
velocityGradient = PYB11readonly(static=True)
internalVelocityGradient = PYB11readonly(static=True)
hydroAcceleration = PYB11readonly(static=True)
massDensity = PYB11readonly(static=True)
normalization = PYB11readonly(static=True)
specificThermalEnergy = PYB11readonly(static=True)
maxViscousPressure = PYB11readonly(static=True)
effectiveViscousPressure = PYB11readonly(static=True)
massDensityCorrection = PYB11readonly(static=True)
viscousWork = PYB11readonly(static=True)
XSPHDeltaV = PYB11readonly(static=True)
XSPHWeightSum = PYB11readonly(static=True)
Hsmooth = PYB11readonly(static=True)
massFirstMoment = PYB11readonly(static=True)
massSecondMoment = PYB11readonly(static=True)
weightedNeighborSum = PYB11readonly(static=True)
pressure = PYB11readonly(static=True)
temperature = PYB11readonly(static=True)
soundSpeed = PYB11readonly(static=True)
pairAccelerations = PYB11readonly(static=True)
pairWork = PYB11readonly(static=True)
gamma = PYB11readonly(static=True)
entropy = PYB11readonly(static=True)
PSPHcorrection = PYB11readonly(static=True)
omegaGradh = PYB11readonly(static=True)
numberDensitySum = PYB11readonly(static=True)
timeStepMask = PYB11readonly(static=True)
surfacePoint = PYB11readonly(static=True)
voidPoint = PYB11readonly(static=True)
etaVoidPoints = PYB11readonly(static=True)
cells = PYB11readonly(static=True)
cellFaceFlags = PYB11readonly(static=True)
M_SPHCorrection = PYB11readonly(static=True)
volume = PYB11readonly(static=True)
linearMomentum = PYB11readonly(static=True)
totalEnergy = PYB11readonly(static=True)
mesh = PYB11readonly(static=True)
hourglassMask = PYB11readonly(static=True)
faceVelocity = PYB11readonly(static=True)
faceForce = PYB11readonly(static=True)
faceMass = PYB11readonly(static=True)
polyvols = PYB11readonly(static=True)
massDensityGradient = PYB11readonly(static=True)
specificHeat = PYB11readonly(static=True)
normal = PYB11readonly(static=True)
surfaceArea = PYB11readonly(static=True)
mass = PYB11readonly(static=True, returnpolicy="copy")
position = PYB11readonly(static=True, returnpolicy="copy")
velocity = PYB11readonly(static=True, returnpolicy="copy")
H = PYB11readonly(static=True, returnpolicy="copy")
work = PYB11readonly(static=True, returnpolicy="copy")
velocityGradient = PYB11readonly(static=True, returnpolicy="copy")
internalVelocityGradient = PYB11readonly(static=True, returnpolicy="copy")
hydroAcceleration = PYB11readonly(static=True, returnpolicy="copy")
massDensity = PYB11readonly(static=True, returnpolicy="copy")
normalization = PYB11readonly(static=True, returnpolicy="copy")
specificThermalEnergy = PYB11readonly(static=True, returnpolicy="copy")
maxViscousPressure = PYB11readonly(static=True, returnpolicy="copy")
effectiveViscousPressure = PYB11readonly(static=True, returnpolicy="copy")
massDensityCorrection = PYB11readonly(static=True, returnpolicy="copy")
viscousWork = PYB11readonly(static=True, returnpolicy="copy")
XSPHDeltaV = PYB11readonly(static=True, returnpolicy="copy")
XSPHWeightSum = PYB11readonly(static=True, returnpolicy="copy")
Hsmooth = PYB11readonly(static=True, returnpolicy="copy")
massFirstMoment = PYB11readonly(static=True, returnpolicy="copy")
massSecondMoment = PYB11readonly(static=True, returnpolicy="copy")
weightedNeighborSum = PYB11readonly(static=True, returnpolicy="copy")
pressure = PYB11readonly(static=True, returnpolicy="copy")
temperature = PYB11readonly(static=True, returnpolicy="copy")
soundSpeed = PYB11readonly(static=True, returnpolicy="copy")
pairAccelerations = PYB11readonly(static=True, returnpolicy="copy")
pairWork = PYB11readonly(static=True, returnpolicy="copy")
gamma = PYB11readonly(static=True, returnpolicy="copy")
entropy = PYB11readonly(static=True, returnpolicy="copy")
PSPHcorrection = PYB11readonly(static=True, returnpolicy="copy")
omegaGradh = PYB11readonly(static=True, returnpolicy="copy")
numberDensitySum = PYB11readonly(static=True, returnpolicy="copy")
timeStepMask = PYB11readonly(static=True, returnpolicy="copy")
surfacePoint = PYB11readonly(static=True, returnpolicy="copy")
voidPoint = PYB11readonly(static=True, returnpolicy="copy")
etaVoidPoints = PYB11readonly(static=True, returnpolicy="copy")
cells = PYB11readonly(static=True, returnpolicy="copy")
cellFaceFlags = PYB11readonly(static=True, returnpolicy="copy")
M_SPHCorrection = PYB11readonly(static=True, returnpolicy="copy")
volume = PYB11readonly(static=True, returnpolicy="copy")
linearMomentum = PYB11readonly(static=True, returnpolicy="copy")
totalEnergy = PYB11readonly(static=True, returnpolicy="copy")
mesh = PYB11readonly(static=True, returnpolicy="copy")
hourglassMask = PYB11readonly(static=True, returnpolicy="copy")
faceVelocity = PYB11readonly(static=True, returnpolicy="copy")
faceForce = PYB11readonly(static=True, returnpolicy="copy")
faceMass = PYB11readonly(static=True, returnpolicy="copy")
polyvols = PYB11readonly(static=True, returnpolicy="copy")
massDensityGradient = PYB11readonly(static=True, returnpolicy="copy")
specificHeat = PYB11readonly(static=True, returnpolicy="copy")
normal = PYB11readonly(static=True, returnpolicy="copy")
surfaceArea = PYB11readonly(static=True, returnpolicy="copy")
12 changes: 6 additions & 6 deletions src/Pybind11Wraps/Mesh/Mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class Mesh:

#...........................................................................
# Static attributes
UNSETID = PYB11readonly(static=True)
minFacesPerZone = PYB11readonly(static=True)
minEdgesPerZone = PYB11readonly(static=True)
minNodesPerZone = PYB11readonly(static=True)
minEdgesPerFace = PYB11readonly(static=True)
minNodesPerFace = PYB11readonly(static=True)
UNSETID = PYB11readonly(static=True, returnpolicy="copy")
minFacesPerZone = PYB11readonly(static=True, returnpolicy="copy")
minEdgesPerZone = PYB11readonly(static=True, returnpolicy="copy")
minNodesPerZone = PYB11readonly(static=True, returnpolicy="copy")
minEdgesPerFace = PYB11readonly(static=True, returnpolicy="copy")
minNodesPerFace = PYB11readonly(static=True, returnpolicy="copy")

#...........................................................................
# Constructors
Expand Down
6 changes: 3 additions & 3 deletions src/Pybind11Wraps/RK/RKFieldNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class RKFieldNames:

rkOrders = PYB11readonly(static=True)
rkCorrectionsBase = PYB11readonly(static=True)
reproducingKernelBase = PYB11readonly(static=True)
rkOrders = PYB11readonly(static=True, returnpolicy="copy")
rkCorrectionsBase = PYB11readonly(static=True, returnpolicy="copy")
reproducingKernelBase = PYB11readonly(static=True, returnpolicy="copy")

@PYB11static
def rkCorrections(order = "const RKOrder"):
Expand Down
6 changes: 3 additions & 3 deletions src/Pybind11Wraps/SVPH/SVPHFieldNames.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class SVPHFieldNames:

A_SVPH = PYB11readonly(static=True)
B_SVPH = PYB11readonly(static=True)
gradB_SVPH = PYB11readonly(static=True)
A_SVPH = PYB11readonly(static=True, returnpolicy="copy")
B_SVPH = PYB11readonly(static=True, returnpolicy="copy")
gradB_SVPH = PYB11readonly(static=True, returnpolicy="copy")
52 changes: 26 additions & 26 deletions src/Pybind11Wraps/Strength/StrengthMOD.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@
#-------------------------------------------------------------------------------
class SolidFieldNames:

deviatoricStress = PYB11readonly(static=True)
deviatoricStressTT = PYB11readonly(static=True)
plasticStrain = PYB11readonly(static=True)
plasticStrainRate = PYB11readonly(static=True)
scalarDamage = PYB11readonly(static=True)
tensorDamage = PYB11readonly(static=True)
effectiveTensorDamage = PYB11readonly(static=True)
damageGradient = PYB11readonly(static=True)
damageHat = PYB11readonly(static=True)
strain = PYB11readonly(static=True)
strainTensor = PYB11readonly(static=True)
effectiveStrainTensor = PYB11readonly(static=True)
bulkModulus = PYB11readonly(static=True)
shearModulus = PYB11readonly(static=True)
YoungsModulus = PYB11readonly(static=True)
longitudinalSoundSpeed = PYB11readonly(static=True)
yieldStrength = PYB11readonly(static=True)
flaws = PYB11readonly(static=True)
effectiveFlaws = PYB11readonly(static=True)
porosityAlpha = PYB11readonly(static=True)
porosityStrain = PYB11readonly(static=True)
porosityAlpha0 = PYB11readonly(static=True)
porosityc0 = PYB11readonly(static=True)
fragmentIDs = PYB11readonly(static=True)
particleTypes = PYB11readonly(static=True)
meltSpecificEnergy = PYB11readonly(static=True)
deviatoricStress = PYB11readonly(static=True, returnpolicy="copy")
deviatoricStressTT = PYB11readonly(static=True, returnpolicy="copy")
plasticStrain = PYB11readonly(static=True, returnpolicy="copy")
plasticStrainRate = PYB11readonly(static=True, returnpolicy="copy")
scalarDamage = PYB11readonly(static=True, returnpolicy="copy")
tensorDamage = PYB11readonly(static=True, returnpolicy="copy")
effectiveTensorDamage = PYB11readonly(static=True, returnpolicy="copy")
damageGradient = PYB11readonly(static=True, returnpolicy="copy")
damageHat = PYB11readonly(static=True, returnpolicy="copy")
strain = PYB11readonly(static=True, returnpolicy="copy")
strainTensor = PYB11readonly(static=True, returnpolicy="copy")
effectiveStrainTensor = PYB11readonly(static=True, returnpolicy="copy")
bulkModulus = PYB11readonly(static=True, returnpolicy="copy")
shearModulus = PYB11readonly(static=True, returnpolicy="copy")
YoungsModulus = PYB11readonly(static=True, returnpolicy="copy")
longitudinalSoundSpeed = PYB11readonly(static=True, returnpolicy="copy")
yieldStrength = PYB11readonly(static=True, returnpolicy="copy")
flaws = PYB11readonly(static=True, returnpolicy="copy")
effectiveFlaws = PYB11readonly(static=True, returnpolicy="copy")
porosityAlpha = PYB11readonly(static=True, returnpolicy="copy")
porosityStrain = PYB11readonly(static=True, returnpolicy="copy")
porosityAlpha0 = PYB11readonly(static=True, returnpolicy="copy")
porosityc0 = PYB11readonly(static=True, returnpolicy="copy")
fragmentIDs = PYB11readonly(static=True, returnpolicy="copy")
particleTypes = PYB11readonly(static=True, returnpolicy="copy")
meltSpecificEnergy = PYB11readonly(static=True, returnpolicy="copy")
14 changes: 7 additions & 7 deletions src/Pybind11Wraps/Utilities/KeyTraits.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class KeyTraits:
"""Encapsulate how we think about keys for the space filling curves.
This is specialized assuming we're working with 64 bit uint64_t."""

numbits = PYB11readonly(static=True, doc="Total number of bits in a Key")
numbits1d = PYB11readonly(static=True, doc="Number of bits allowed per dimension in a Key")
zero = PYB11readonly(static=True, doc="Null value")
one = PYB11readonly(static=True, doc="Unit value")
two = PYB11readonly(static=True, doc="Like, the two value")
maxKey1d = PYB11readonly(static=True, doc="The maximum value in a dimension")
maxKey = PYB11readonly(static=True, doc="The maximum possible key")
numbits = PYB11readonly(static=True, doc="Total number of bits in a Key", returnpolicy="copy")
numbits1d = PYB11readonly(static=True, doc="Number of bits allowed per dimension in a Key", returnpolicy="copy")
zero = PYB11readonly(static=True, doc="Null value", returnpolicy="copy")
one = PYB11readonly(static=True, doc="Unit value", returnpolicy="copy")
two = PYB11readonly(static=True, doc="Like, the two value", returnpolicy="copy")
maxKey1d = PYB11readonly(static=True, doc="The maximum value in a dimension", returnpolicy="copy")
maxKey = PYB11readonly(static=True, doc="The maximum possible key", returnpolicy="copy")