Compare commits
7 Commits
a97402add3
...
04b5f29888
Author | SHA1 | Date | |
---|---|---|---|
04b5f29888 | |||
c49b8eb034 | |||
c034ae81fd | |||
5acf0ac347 | |||
2a1ae3b1a7 | |||
0447b5d3a7 | |||
e894c89702 |
13
CHANGELOG.md
13
CHANGELOG.md
@ -2,6 +2,19 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.8.7](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.6...0.8.7) (2022-09-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adds xy model for convenience to pdme ([e894c89](https://gitea.deepak.science:2222/physics/pdme/commit/e894c897029c05a1d4754e7930ae9ba2be7a1cfd))
|
||||||
|
* moves xy model up to model package ([2a1ae3b](https://gitea.deepak.science:2222/physics/pdme/commit/2a1ae3b1a7f7e10469b7fd2930fee0b338f0c03f))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Correctly generates monte carlo version of xy model dipoles ([5acf0ac](https://gitea.deepak.science:2222/physics/pdme/commit/5acf0ac347382705674bb596440d27cba3730bac))
|
||||||
|
|
||||||
### [0.8.6](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.5...0.8.6) (2022-06-13)
|
### [0.8.6](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.5...0.8.6) (2022-06-13)
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,6 +11,10 @@ from pdme.model.log_spaced_random_choice_model import (
|
|||||||
LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel,
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from pdme.model.log_spaced_random_choice_xy_model import (
|
||||||
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel,
|
||||||
|
)
|
||||||
|
|
||||||
from pdme.model.log_spaced_random_choice_fixed_orientation_model import (
|
from pdme.model.log_spaced_random_choice_fixed_orientation_model import (
|
||||||
LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel,
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel,
|
||||||
)
|
)
|
||||||
@ -21,5 +25,6 @@ __all__ = [
|
|||||||
"MultipleDipoleFixedMagnitudeModel",
|
"MultipleDipoleFixedMagnitudeModel",
|
||||||
"RandomCountMultipleDipoleFixedMagnitudeModel",
|
"RandomCountMultipleDipoleFixedMagnitudeModel",
|
||||||
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel",
|
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel",
|
||||||
|
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel",
|
||||||
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel",
|
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel",
|
||||||
]
|
]
|
||||||
|
125
pdme/model/log_spaced_random_choice_xy_model.py
Normal file
125
pdme/model/log_spaced_random_choice_xy_model.py
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
import numpy
|
||||||
|
import numpy.random
|
||||||
|
from pdme.model.model import DipoleModel
|
||||||
|
from pdme.measurement import (
|
||||||
|
OscillatingDipole,
|
||||||
|
OscillatingDipoleArrangement,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(DipoleModel):
|
||||||
|
"""
|
||||||
|
Model of multiple oscillating dipoles with a fixed magnitude, but free rotation in XY plane. Spaced logarithmically.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
|
||||||
|
wexp_min: log-10 lower bound for dipole frequency
|
||||||
|
wexp_min: log-10 upper bound for dipole frequency
|
||||||
|
|
||||||
|
pfixed : float
|
||||||
|
The fixed dipole magnitude.
|
||||||
|
|
||||||
|
n_max : int
|
||||||
|
The maximum number of dipoles.
|
||||||
|
|
||||||
|
prob_occupancy : float
|
||||||
|
The probability of dipole occupancy
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
xmin: float,
|
||||||
|
xmax: float,
|
||||||
|
ymin: float,
|
||||||
|
ymax: float,
|
||||||
|
zmin: float,
|
||||||
|
zmax: float,
|
||||||
|
wexp_min: float,
|
||||||
|
wexp_max: float,
|
||||||
|
pfixed: float,
|
||||||
|
n_max: int,
|
||||||
|
prob_occupancy: float,
|
||||||
|
) -> None:
|
||||||
|
self.xmin = xmin
|
||||||
|
self.xmax = xmax
|
||||||
|
self.ymin = ymin
|
||||||
|
self.ymax = ymax
|
||||||
|
self.zmin = zmin
|
||||||
|
self.zmax = zmax
|
||||||
|
self.wexp_min = wexp_min
|
||||||
|
self.wexp_max = wexp_max
|
||||||
|
self.pfixed = pfixed
|
||||||
|
self.rng = numpy.random.default_rng()
|
||||||
|
self.n_max = n_max
|
||||||
|
if prob_occupancy >= 1 or prob_occupancy <= 0:
|
||||||
|
raise ValueError(
|
||||||
|
f"The probability of a dipole site occupancy must be between 0 and 1, got {prob_occupancy}"
|
||||||
|
)
|
||||||
|
self.prob_occupancy = prob_occupancy
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f"LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.wexp_min}, {self.wexp_max}, {self.pfixed}, {self.n_max}, {self.prob_occupancy})"
|
||||||
|
|
||||||
|
def get_dipoles(
|
||||||
|
self, max_frequency: float, rng_to_use: numpy.random.Generator = None
|
||||||
|
) -> OscillatingDipoleArrangement:
|
||||||
|
rng: numpy.random.Generator
|
||||||
|
if rng_to_use is None:
|
||||||
|
rng = self.rng
|
||||||
|
else:
|
||||||
|
rng = rng_to_use
|
||||||
|
|
||||||
|
dipoles = []
|
||||||
|
|
||||||
|
n = rng.binomial(self.n_max, self.prob_occupancy)
|
||||||
|
|
||||||
|
for i in range(n):
|
||||||
|
phi = rng.uniform(0, 2 * numpy.pi)
|
||||||
|
px = self.pfixed * numpy.cos(phi)
|
||||||
|
py = self.pfixed * numpy.sin(phi)
|
||||||
|
pz = 0
|
||||||
|
s_pts = numpy.array(
|
||||||
|
(
|
||||||
|
rng.uniform(self.xmin, self.xmax),
|
||||||
|
rng.uniform(self.ymin, self.ymax),
|
||||||
|
rng.uniform(self.zmin, self.zmax),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
frequency = 10 ** rng.uniform(self.wexp_min, self.wexp_max)
|
||||||
|
|
||||||
|
dipoles.append(
|
||||||
|
OscillatingDipole(numpy.array([px, py, pz]), s_pts, frequency)
|
||||||
|
)
|
||||||
|
return OscillatingDipoleArrangement(dipoles)
|
||||||
|
|
||||||
|
def get_monte_carlo_dipole_inputs(
|
||||||
|
self,
|
||||||
|
monte_carlo_n: int,
|
||||||
|
_: float,
|
||||||
|
rng_to_use: numpy.random.Generator = None,
|
||||||
|
) -> numpy.ndarray:
|
||||||
|
|
||||||
|
rng: numpy.random.Generator
|
||||||
|
if rng_to_use is None:
|
||||||
|
rng = self.rng
|
||||||
|
else:
|
||||||
|
rng = rng_to_use
|
||||||
|
|
||||||
|
shape = (monte_carlo_n, self.n_max)
|
||||||
|
phi = 2 * numpy.pi * rng.random(shape)
|
||||||
|
|
||||||
|
p_mask = rng.binomial(1, self.prob_occupancy, shape)
|
||||||
|
p_magnitude = self.pfixed * p_mask
|
||||||
|
|
||||||
|
px = p_magnitude * numpy.cos(phi)
|
||||||
|
py = p_magnitude * numpy.sin(phi)
|
||||||
|
pz = p_magnitude * 0
|
||||||
|
|
||||||
|
sx = rng.uniform(self.xmin, self.xmax, shape)
|
||||||
|
sy = rng.uniform(self.ymin, self.ymax, shape)
|
||||||
|
sz = rng.uniform(self.zmin, self.zmax, shape)
|
||||||
|
|
||||||
|
w = 10 ** rng.uniform(self.wexp_min, self.wexp_max, shape)
|
||||||
|
|
||||||
|
return numpy.stack([px, py, pz, sx, sy, sz, w], axis=-1)
|
16
poetry.lock
generated
16
poetry.lock
generated
@ -93,7 +93,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coverage"
|
name = "coverage"
|
||||||
version = "6.4.2"
|
version = "6.4.4"
|
||||||
description = "Code coverage measurement for Python"
|
description = "Code coverage measurement for Python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
@ -213,11 +213,11 @@ python-versions = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mypy"
|
name = "mypy"
|
||||||
version = "0.971"
|
version = "0.981"
|
||||||
description = "Optional static typing for Python"
|
description = "Optional static typing for Python"
|
||||||
category = "dev"
|
category = "dev"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.6"
|
python-versions = ">=3.7"
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
mypy-extensions = ">=0.4.3"
|
mypy-extensions = ">=0.4.3"
|
||||||
@ -316,8 +316,8 @@ optional = false
|
|||||||
python-versions = ">=3.6"
|
python-versions = ">=3.6"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
dev = ["pre-commit", "tox"]
|
testing = ["pytest-benchmark", "pytest"]
|
||||||
testing = ["pytest", "pytest-benchmark"]
|
dev = ["tox", "pre-commit"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prompt-toolkit"
|
name = "prompt-toolkit"
|
||||||
@ -426,7 +426,7 @@ coverage = {version = ">=5.2.1", extras = ["toml"]}
|
|||||||
pytest = ">=4.6"
|
pytest = ">=4.6"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"]
|
testing = ["virtualenv", "pytest-xdist", "six", "process-tests", "hunter", "fields"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scipy"
|
name = "scipy"
|
||||||
@ -461,7 +461,7 @@ executing = "*"
|
|||||||
pure-eval = "*"
|
pure-eval = "*"
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
tests = ["pytest", "typeguard", "pygments", "littleutils", "cython"]
|
tests = ["cython", "littleutils", "pygments", "typeguard", "pytest"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "toml"
|
name = "toml"
|
||||||
@ -509,7 +509,7 @@ python-versions = "*"
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "1.1"
|
lock-version = "1.1"
|
||||||
python-versions = "^3.8,<3.10"
|
python-versions = "^3.8,<3.10"
|
||||||
content-hash = "6bc856a42b4b47d346e726ce00eb556781a309cb87ae4ea81df3667714ed571b"
|
content-hash = "f6c96a07783db001d2cd72c255e34baa809532f30baad8d6220554844a5166bb"
|
||||||
|
|
||||||
[metadata.files]
|
[metadata.files]
|
||||||
appnope = []
|
appnope = []
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pdme"
|
name = "pdme"
|
||||||
version = "0.8.6"
|
version = "0.8.7"
|
||||||
description = "Python dipole model evaluator"
|
description = "Python dipole model evaluator"
|
||||||
authors = ["Deepak <dmallubhotla+github@gmail.com>"]
|
authors = ["Deepak <dmallubhotla+github@gmail.com>"]
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
@ -15,7 +15,7 @@ scipy = "~1.8"
|
|||||||
pytest = ">=6"
|
pytest = ">=6"
|
||||||
flake8 = "^4.0.0"
|
flake8 = "^4.0.0"
|
||||||
pytest-cov = "^3.0.0"
|
pytest-cov = "^3.0.0"
|
||||||
mypy = "^0.971"
|
mypy = "^0.981"
|
||||||
ipython = "^8.2.0"
|
ipython = "^8.2.0"
|
||||||
black = "^22.3.0"
|
black = "^22.3.0"
|
||||||
|
|
||||||
|
@ -0,0 +1,206 @@
|
|||||||
|
from pdme.model import LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel
|
||||||
|
import numpy
|
||||||
|
import logging
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def test_random_count_multiple_dipole_xy_wrong_probability():
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
-10, 10, -5, 5, 2, 3, 1, 2, 10, 5, 2
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_repr_random_count_multiple_dipole_fixed_mag_xy():
|
||||||
|
model = LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
-10, 10, -5, 5, 2, 3, 1, 2, 10, 5, 0.5
|
||||||
|
)
|
||||||
|
assert (
|
||||||
|
repr(model)
|
||||||
|
== "LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(-10, 10, -5, 5, 2, 3, 1, 2, 10, 5, 0.5)"
|
||||||
|
), "Repr should be what I want."
|
||||||
|
|
||||||
|
|
||||||
|
def test_random_count_multiple_dipole_fixed_mag_model_get_dipoles_multiple_xy():
|
||||||
|
|
||||||
|
p_fixed = 10
|
||||||
|
dipole_count = 5
|
||||||
|
|
||||||
|
model = LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
-10, 10, -5, 5, 2, 3, 0, 5, p_fixed, dipole_count, 0.5
|
||||||
|
)
|
||||||
|
|
||||||
|
dipole_arrangement = model.get_dipoles(20, numpy.random.default_rng(1234))
|
||||||
|
dipoles = dipole_arrangement.dipoles
|
||||||
|
|
||||||
|
assert (
|
||||||
|
len(dipoles) == dipole_count
|
||||||
|
), "Should have had multiple dipole based on count generated."
|
||||||
|
|
||||||
|
|
||||||
|
def test_random_count_multiple_dipole_fixed_mag_model_get_dipoles_invariant_xy():
|
||||||
|
|
||||||
|
x_min = -10
|
||||||
|
x_max = 10
|
||||||
|
y_min = -5
|
||||||
|
y_max = 5
|
||||||
|
z_min = 2
|
||||||
|
z_max = 3
|
||||||
|
p_fixed = 10
|
||||||
|
max_frequency = 5
|
||||||
|
|
||||||
|
model = LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
x_min, x_max, y_min, y_max, z_min, z_max, 0, max_frequency, p_fixed, 1, 0.5
|
||||||
|
)
|
||||||
|
model.rng = numpy.random.default_rng(1234)
|
||||||
|
|
||||||
|
dipole_arrangement = model.get_dipoles(5)
|
||||||
|
dipoles = dipole_arrangement.dipoles
|
||||||
|
|
||||||
|
assert len(dipoles) == 1, "Should have only had one dipole generated."
|
||||||
|
for i in range(10):
|
||||||
|
dipole_arrangement = model.get_dipoles(max_frequency)
|
||||||
|
dipoles = dipole_arrangement.dipoles
|
||||||
|
|
||||||
|
assert len(dipoles) in (
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
), "Should have either zero or one dipole generated."
|
||||||
|
|
||||||
|
if len(dipoles) > 0:
|
||||||
|
min_s = numpy.array([x_min, y_min, z_min])
|
||||||
|
max_s = numpy.array([x_max, y_max, z_max])
|
||||||
|
|
||||||
|
numpy.testing.assert_equal(
|
||||||
|
numpy.logical_and(min_s < dipoles[0].s, max_s > dipoles[0].s),
|
||||||
|
True,
|
||||||
|
f"Dipole location [{dipoles[0].s}] should have been between min [{min_s}] and max [{max_s}] bounds.",
|
||||||
|
)
|
||||||
|
assert (
|
||||||
|
dipoles[0].w < 10 ** max_frequency and dipoles[0].w > 10**0
|
||||||
|
), "Dipole frequency should have been between 0 and max."
|
||||||
|
|
||||||
|
numpy.testing.assert_allclose(
|
||||||
|
numpy.linalg.norm(dipoles[0].p),
|
||||||
|
p_fixed,
|
||||||
|
err_msg="Should have had the expected dipole moment magnitude.",
|
||||||
|
)
|
||||||
|
|
||||||
|
_logger.warning(dipoles[0].p)
|
||||||
|
numpy.testing.assert_allclose(
|
||||||
|
dipoles[0].p[2],
|
||||||
|
0,
|
||||||
|
err_msg="Should have had zero z magnitude.",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_random_count_multiple_dipole_fixed_mag_model_get_dipoles_invariant_monte_carlo_xy():
|
||||||
|
|
||||||
|
x_min = -10
|
||||||
|
x_max = 10
|
||||||
|
y_min = -5
|
||||||
|
y_max = 5
|
||||||
|
z_min = 2
|
||||||
|
z_max = 3
|
||||||
|
p_fixed = 10
|
||||||
|
max_frequency = 5
|
||||||
|
monte_carlo_n = 20
|
||||||
|
|
||||||
|
model = LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
x_min, x_max, y_min, y_max, z_min, z_max, 0, max_frequency, p_fixed, 1, 0.5
|
||||||
|
)
|
||||||
|
model.rng = numpy.random.default_rng(1234)
|
||||||
|
|
||||||
|
dipole_arrangement = model.get_dipoles(5)
|
||||||
|
dipoles = dipole_arrangement.dipoles
|
||||||
|
|
||||||
|
assert len(dipoles) == 1, "Should have only had one dipole generated."
|
||||||
|
for i in range(10):
|
||||||
|
dipoles = model.get_monte_carlo_dipole_inputs(monte_carlo_n, max_frequency)
|
||||||
|
|
||||||
|
min_s = numpy.array([x_min, y_min, z_min])
|
||||||
|
max_s = numpy.array([x_max, y_max, z_max])
|
||||||
|
|
||||||
|
_logger.warning(dipoles)
|
||||||
|
_logger.warning(dipoles[:, 0, 0:3])
|
||||||
|
_logger.warning(dipoles[:, 0, 3:6])
|
||||||
|
_logger.warning(dipoles[:, 0, 6])
|
||||||
|
|
||||||
|
ps = dipoles[:, 0, 0:3]
|
||||||
|
ss = dipoles[:, 0, 3:6]
|
||||||
|
ws = dipoles[:, 0, 6]
|
||||||
|
|
||||||
|
numpy.testing.assert_equal(
|
||||||
|
numpy.logical_and(min_s < ss, max_s > ss).all(),
|
||||||
|
True,
|
||||||
|
f"Dipole location [{ss}] should have been between min [{min_s}] and max [{max_s}] bounds.",
|
||||||
|
)
|
||||||
|
assert (ws < 10**max_frequency).all() and (
|
||||||
|
ws > 10**0
|
||||||
|
).all(), "Dipole frequency should have been between 0 and max."
|
||||||
|
|
||||||
|
norms = numpy.linalg.norm(ps, axis=1)
|
||||||
|
filtered_norms = norms[norms > 0]
|
||||||
|
numpy.testing.assert_allclose(
|
||||||
|
filtered_norms,
|
||||||
|
p_fixed,
|
||||||
|
err_msg="Should have had the expected dipole moment magnitude.",
|
||||||
|
)
|
||||||
|
|
||||||
|
numpy.testing.assert_allclose(
|
||||||
|
ps[:, 2],
|
||||||
|
0,
|
||||||
|
err_msg="Should have had zero z magnitude.",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_random_count_multiple_dipole_shape():
|
||||||
|
|
||||||
|
x_min = -10
|
||||||
|
x_max = 10
|
||||||
|
y_min = -5
|
||||||
|
y_max = 5
|
||||||
|
z_min = 2
|
||||||
|
z_max = 3
|
||||||
|
p_fixed = 10
|
||||||
|
max_frequency = 5
|
||||||
|
num_dipoles = 13
|
||||||
|
monte_carlo_n = 11
|
||||||
|
|
||||||
|
model = LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel(
|
||||||
|
x_min,
|
||||||
|
x_max,
|
||||||
|
y_min,
|
||||||
|
y_max,
|
||||||
|
z_min,
|
||||||
|
z_max,
|
||||||
|
0,
|
||||||
|
max_frequency,
|
||||||
|
p_fixed,
|
||||||
|
num_dipoles,
|
||||||
|
0.5,
|
||||||
|
)
|
||||||
|
model.rng = numpy.random.default_rng(1234)
|
||||||
|
|
||||||
|
actual_shape = model.get_monte_carlo_dipole_inputs(
|
||||||
|
monte_carlo_n, max_frequency
|
||||||
|
).shape
|
||||||
|
|
||||||
|
numpy.testing.assert_equal(
|
||||||
|
actual_shape,
|
||||||
|
(monte_carlo_n, num_dipoles, 7),
|
||||||
|
err_msg="shape was wrong for monte carlo outputs",
|
||||||
|
)
|
||||||
|
|
||||||
|
actual_shape = model.get_monte_carlo_dipole_inputs(
|
||||||
|
monte_carlo_n, max_frequency, rng_to_use=numpy.random.default_rng(1515)
|
||||||
|
).shape
|
||||||
|
|
||||||
|
numpy.testing.assert_equal(
|
||||||
|
actual_shape,
|
||||||
|
(monte_carlo_n, num_dipoles, 7),
|
||||||
|
err_msg="shape was wrong for monte carlo outputs",
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user