Compare commits
182 Commits
Author | SHA1 | Date | |
---|---|---|---|
885508e104 | |||
6193ecb9c9 | |||
5ad442750e | |||
9b1538b3c6 | |||
7b277fdc85 | |||
e5fc1207a8 | |||
387a607e09 | |||
9e6d1df559 | |||
45031857f2 | |||
64181eeef2 | |||
d682d50554 | |||
e9e34162a3 | |||
32a7812a43 | |||
7c39475742 | |||
1dd7569fde | |||
4a63552129 | |||
9c88c9ab96 | |||
631ba13c79 | |||
e2bdeda638 | |||
806b9b667f | |||
e61838d85f | |||
3ebe2bb824 | |||
ed9dd2c94f | |||
74c1b01a6c | |||
50f98ed89b | |||
18cc48471d | |||
d60a0cb386 | |||
e01d0e14a9 | |||
dfaf8abed5 | |||
ca710e359f | |||
dc43e4bfbc | |||
dbf924490e | |||
f280448cfe | |||
feb0a5f645 | |||
e9bb62c0a0 | |||
857391425f | |||
46dc6dd6d9 | |||
29abc8af89 | |||
23e3b95bb6 | |||
a326e80e00 | |||
56f660ff25 | |||
a5fd9c2304 | |||
0dbe874ac4 | |||
36454d5044 | |||
156019fdac | |||
c49b8eb034 | |||
c034ae81fd | |||
5acf0ac347 | |||
2a1ae3b1a7 | |||
0447b5d3a7 | |||
e894c89702 | |||
7566744c96 | |||
b9621ff55d | |||
6277e843d5 | |||
ed0c6e2858 | |||
ad87d5ebde | |||
96a3a8fac4 | |||
7f69b2009c | |||
b4b0767443 | |||
f6525b84b6 | |||
50323b4ed7 | |||
280de7280b | |||
9b55e5e581 | |||
d19466cea6 | |||
33c4da6281 | |||
aff7b4ba26 | |||
2cdf46afa1 | |||
eb080fed02 | |||
0bd179232e | |||
01f905a237 | |||
5da9eddd7b | |||
2c6b62ca95 | |||
b48bb67605 | |||
8cbb3eaeee | |||
7a9fa1ba04 | |||
6587ab4800 | |||
dfdff12997 | |||
623cadea2e | |||
333a5af1dc | |||
27cbb364a6 | |||
ab25de9558 | |||
79957edf21 | |||
8264ca3d6e | |||
3b3078ef23 | |||
55d4e3252d | |||
cb3c280464 | |||
58441b8ddb | |||
011400fa97 | |||
a777b713f3 | |||
f18d805e0d | |||
ee6a2773bc | |||
0c64ed02f0 | |||
fe5273346b | |||
8cd08da854 | |||
1bad2f743a | |||
b670bc3fa4 | |||
029021e393 | |||
7930d8f7ab | |||
bc06f2a368 | |||
70d95c8d6d | |||
bbfbfa359a | |||
0f78c7c2db | |||
7eba3311c7 | |||
0d5508a0b5 | |||
946945d791 | |||
c04d863d7f | |||
6d2f01f8d7 | |||
b41d6ee897 | |||
ab244ed91d | |||
ccbb048d26 | |||
d89d3585da | |||
b3adf33f59 | |||
5c6c4c79d1 | |||
a390282e45 | |||
944c688ecf | |||
7f14d68548 | |||
8a60967ddf | |||
f2cb33e78b | |||
ca7836d555 | |||
5321fb2071 | |||
a7508b8906 | |||
e72489f0cb | |||
852836b924 | |||
5fbff2a5c0 | |||
63f02e00b3 | |||
5c27438973 | |||
776ae127f2 | |||
b0b63f2257 | |||
66bac59a55 | |||
068ae21da5 | |||
aca96ca80c | |||
7d550a8e9e | |||
f83a41ccdc | |||
6a1a4a58ab | |||
b5f488ff6c | |||
98c3f3017f | |||
c6f09fdbe9 | |||
548dcfebfc | |||
7a2f34de3b | |||
9f428af1ca | |||
7c368d28b6 | |||
c70a971ce0 | |||
a782b4957f | |||
bf1dd0f487 | |||
08559110be | |||
2d773df725 | |||
92ce8d31dd | |||
2c14f8fc3e | |||
f44b4b589b | |||
490d2fba4b | |||
092457254f | |||
6baaa4787f | |||
738cc5173b | |||
7903038174 | |||
31762de697 | |||
641ea70bc1 | |||
e11b765176 | |||
5ef9dfecbf | |||
a86d0ddcd4 | |||
53d6cec4cd | |||
1d5dd50821 | |||
d50fad166b | |||
fe97d4a5c5 | |||
ab6a566bc6 | |||
bba330569e | |||
d9923b6a6c | |||
6c30719b63 | |||
ef4af9ff83 | |||
4d2c2bdd61 | |||
9933ef3bbf | |||
d139b02056 | |||
37b58a8f88 | |||
688f76f560 | |||
598201774d | |||
565f0aeab1 | |||
cf1f1a92ab | |||
da7892adbd | |||
f2f76cd8d8 | |||
71e0a81107 | |||
469a78b0bb | |||
df27b4028b | |||
1e3a0f9935 |
@ -3,5 +3,5 @@ root = true
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
# insert_final_newline = true
|
||||
indent_style = tab
|
||||
|
2
.flake8
2
.flake8
@ -1,3 +1,3 @@
|
||||
[flake8]
|
||||
ignore = W191, E501, W503
|
||||
ignore = W191, E501, W503, E203
|
||||
max-line-length = 120
|
||||
|
9
.gitignore
vendored
9
.gitignore
vendored
@ -114,6 +114,10 @@ ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
#direnv
|
||||
.envrc
|
||||
.direnv
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
@ -136,4 +140,7 @@ dmypy.json
|
||||
.pytype/
|
||||
|
||||
# Cython debug symbols
|
||||
cython_debug/
|
||||
cython_debug/
|
||||
|
||||
.csv
|
||||
.idea
|
||||
|
10
.versionrc
Normal file
10
.versionrc
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"bumpFiles": [
|
||||
{
|
||||
"filename": "pyproject.toml",
|
||||
"updater": "scripts/standard-version/pyproject-updater.js"
|
||||
}
|
||||
],
|
||||
"sign": true,
|
||||
"tag-prefix": ""
|
||||
}
|
249
CHANGELOG.md
Normal file
249
CHANGELOG.md
Normal file
@ -0,0 +1,249 @@
|
||||
# Changelog
|
||||
|
||||
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.
|
||||
|
||||
## [1.5.0](https://gitea.deepak.science:2222/physics/pdme/compare/1.4.0...1.5.0) (2024-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds mcmc chain that returns number of repeats ([6193ecb](https://gitea.deepak.science:2222/physics/pdme/commit/6193ecb9c9f7a21d24e860987a7107549a4b2fa7))
|
||||
|
||||
## [1.4.0](https://gitea.deepak.science:2222/physics/pdme/compare/1.3.0...1.4.0) (2024-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds relative squared diff calc utility method ([9b1538b](https://gitea.deepak.science:2222/physics/pdme/commit/9b1538b3c63bfaf2a779bb109cd160a8d7887195))
|
||||
|
||||
## [1.3.0](https://gitea.deepak.science:2222/physics/pdme/compare/1.2.0...1.3.0) (2024-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds utility function for sorting samples by frequency for subspace simulation ([e5fc120](https://gitea.deepak.science:2222/physics/pdme/commit/e5fc1207a8b7d5b67208ad825907baa442eec648))
|
||||
|
||||
## [1.2.0](https://gitea.deepak.science:2222/physics/pdme/compare/1.1.0...1.2.0) (2024-05-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds pdme fast calc for e field xs ([9e6d1df](https://gitea.deepak.science:2222/physics/pdme/commit/9e6d1df559e58998851a1c2bf24fcc46d8c1b148))
|
||||
|
||||
## [1.1.0](https://gitea.deepak.science:2222/physics/pdme/compare/1.0.0...1.1.0) (2024-05-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds both electric potential and electric field x sources, makes some fast util tests use the slower explicit versions as double check ([e9e3416](https://gitea.deepak.science:2222/physics/pdme/commit/e9e34162a3b84faad5c18ddeda327c2f7f5ac5aa))
|
||||
|
||||
## [1.0.0](https://gitea.deepak.science:2222/physics/pdme/compare/0.9.3...1.0.0) (2024-04-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixes the broken implementation of the tarucha frequency calculation ([631ba13](https://gitea.deepak.science:2222/physics/pdme/commit/631ba13c791c71ad8922d39a13b780a40eac2391))
|
||||
|
||||
### [0.9.3](https://gitea.deepak.science:2222/physics/pdme/compare/0.9.2...0.9.3) (2024-02-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds util func for calculating arg using sign instead of complex arithmetic ([3ebe2bb](https://gitea.deepak.science:2222/physics/pdme/commit/3ebe2bb82430d677680383c42a1c269df83d99cd))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixes stupid cost shape issue ([ed9dd2c](https://gitea.deepak.science:2222/physics/pdme/commit/ed9dd2c94f88a08c36f581f05b26a87a6b780d5b))
|
||||
|
||||
### [0.9.2](https://gitea.deepak.science:2222/physics/pdme/compare/0.9.1...0.9.2) (2023-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update tests but for git also don't wrap costs ([50f98ed](https://gitea.deepak.science:2222/physics/pdme/commit/50f98ed89b2a05cd47c41958036dd50bc872e07c))
|
||||
|
||||
### [0.9.1](https://gitea.deepak.science:2222/physics/pdme/compare/0.9.0...0.9.1) (2023-07-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixes some of the shape mangling of our mcmc code ([e01d0e1](https://gitea.deepak.science:2222/physics/pdme/commit/e01d0e14a9bcd6d7e8fe9449ce562dbf1b8fd25c))
|
||||
|
||||
## [0.9.0](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.9...0.9.0) (2023-07-24)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* separates threshold cost and the seed_cost in mcmc
|
||||
|
||||
### Features
|
||||
|
||||
* separates threshold cost and the seed_cost in mcmc ([ca710e3](https://gitea.deepak.science:2222/physics/pdme/commit/ca710e359fd0cfbb620a3574a2fa4fab1be2b52a))
|
||||
|
||||
### [0.8.9](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.8...0.8.9) (2023-07-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds a bunch of mcmc generation code for log spaced models, yay ([f280448](https://gitea.deepak.science:2222/physics/pdme/commit/f280448cfe2fcf5bdc5ac2317ee52b27523bb49d))
|
||||
* adds utility functions for dealing with markov chain monte carlo ([feb0a5f](https://gitea.deepak.science:2222/physics/pdme/commit/feb0a5f6453dcb5e71a07c7749cd579dab15171c))
|
||||
|
||||
### [0.8.8](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.7...0.8.8) (2023-04-09)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds fast calc that allows for variable temp ([36454d5](https://gitea.deepak.science:2222/physics/pdme/commit/36454d5044d93b6b178e016b84dd59a5ebaf15e2))
|
||||
|
||||
### [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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* makes library build system poetry-core ([ed0c6e2](https://gitea.deepak.science:2222/physics/pdme/commit/ed0c6e2858f45fec9b9a673d9b5bc98605e73508))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* pyproject build system now core as well ([6277e84](https://gitea.deepak.science:2222/physics/pdme/commit/6277e843d5a7df8eba1878db490d2fae4052af57))
|
||||
|
||||
### [0.8.5](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.4...0.8.5) (2022-06-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds fixedorientation model ([2cdf46a](https://gitea.deepak.science:2222/physics/pdme/commit/2cdf46afa1492f86b4c403e4c5013cefc89b21d6))
|
||||
|
||||
### [0.8.4](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.3...0.8.4) (2022-05-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* probability of occupancy fixed ([01f905a](https://gitea.deepak.science:2222/physics/pdme/commit/01f905a237a2423f5637ee6a0f43e0937c55d2ea))
|
||||
|
||||
### [0.8.3](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.2...0.8.3) (2022-05-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Adds log spaced in frequency space model ([7a9fa1b](https://gitea.deepak.science:2222/physics/pdme/commit/7a9fa1ba04a12586ef09c89e35e706817012faab))
|
||||
|
||||
### [0.8.2](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.1...0.8.2) (2022-05-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Adds Random count dipole model with binomial type distribution for dipole number ([27cbb36](https://gitea.deepak.science:2222/physics/pdme/commit/27cbb364a6d9625abca6145dafedf0df5743f816))
|
||||
|
||||
### [0.8.1](https://gitea.deepak.science:2222/physics/pdme/compare/0.8.0...0.8.1) (2022-04-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds multidipole nonlocal spectrum calculations ([8264ca3](https://gitea.deepak.science:2222/physics/pdme/commit/8264ca3d6edb703422229fde57bbb1d726ce5139))
|
||||
|
||||
## [0.8.0](https://gitea.deepak.science:2222/physics/pdme/compare/0.7.0...0.8.0) (2022-04-30)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* single dipole still outputs collection now to make interface consistent
|
||||
|
||||
### Features
|
||||
|
||||
* single dipole still outputs collection now to make interface consistent ([cb3c280](https://gitea.deepak.science:2222/physics/pdme/commit/cb3c280464aa2c4b0ec9320e6a319f4a454a0e9f))
|
||||
|
||||
## [0.7.0](https://gitea.deepak.science:2222/physics/pdme/compare/0.6.2...0.7.0) (2022-04-30)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* Changes names of classes to make more clear for dipole model and single dipole fixed magnitude model
|
||||
* reduces model to minimal bayes needed stuff
|
||||
* Guts the model interface for only the things useful for monte carlo bayes stuff
|
||||
* Removes unused models to make refactoring a bit easier
|
||||
|
||||
### Features
|
||||
|
||||
* adds fast method for calculating multiple dipole calculations ([1bad2f7](https://gitea.deepak.science:2222/physics/pdme/commit/1bad2f743af6a95189448d8929c70a036e6c21ab))
|
||||
* adds multidipole fixed mag model ([0c64ed0](https://gitea.deepak.science:2222/physics/pdme/commit/0c64ed02f0d42cd0957be0511a35dc49153a256f))
|
||||
* Changes names of classes to make more clear for dipole model and single dipole fixed magnitude model ([7eba331](https://gitea.deepak.science:2222/physics/pdme/commit/7eba3311c7ba90e4404b1a7b7c33df1585a800ba))
|
||||
* Guts the model interface for only the things useful for monte carlo bayes stuff ([946945d](https://gitea.deepak.science:2222/physics/pdme/commit/946945d791ed763e435afff7a6ae8c2b1c0e1711))
|
||||
* reduces model to minimal bayes needed stuff ([0d5508a](https://gitea.deepak.science:2222/physics/pdme/commit/0d5508a0b5641d98ee6f3484f58c923440c4c2c1))
|
||||
* Removes unused models to make refactoring a bit easier ([c04d863](https://gitea.deepak.science:2222/physics/pdme/commit/c04d863d7fa22c98d8542a5f72791b542358ff61))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* makes name of method match interface ([029021e](https://gitea.deepak.science:2222/physics/pdme/commit/029021e39328c7ca7a73afcf23d86ad17516982f))
|
||||
* makes repr return actual name ([0f78c7c](https://gitea.deepak.science:2222/physics/pdme/commit/0f78c7c2db742d59f2a5ee9da767f35aafa49b78))
|
||||
* uses rng passed in correctly ([70d95c8](https://gitea.deepak.science:2222/physics/pdme/commit/70d95c8d6d5af10f926d8729a5a0eaed9ad8259d))
|
||||
|
||||
### [0.6.2](https://gitea.deepak.science:2222/physics/pdme/compare/0.6.1...0.6.2) (2022-04-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds methods for converting pdme objects into flatter numpy arrays ([5c6c4c7](https://gitea.deepak.science:2222/physics/pdme/commit/5c6c4c79d1b55d8d6bf70e2e54226d282d831f66))
|
||||
* Allows you to pass in rng to generate monte carlo dipoles ([ab244ed](https://gitea.deepak.science:2222/physics/pdme/commit/ab244ed91dede1e3c29fe94ea96089f4c15aa1fb))
|
||||
|
||||
### [0.6.1](https://gitea.deepak.science:2222/physics/pdme/compare/0.6.0...0.6.1) (2022-03-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Swaps high and lows for ranges if needed to make negatives behave nicer ([8a60967](https://gitea.deepak.science:2222/physics/pdme/commit/8a60967ddfa18e49460b05edc7ec575f06db868f))
|
||||
|
||||
## [0.6.0](https://gitea.deepak.science:2222/physics/pdme/compare/0.5.4...0.6.0) (2022-03-27)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* adds pair inputs to array function
|
||||
|
||||
### Features
|
||||
|
||||
* adds calc for pairs and pair ranges ([e72489f](https://gitea.deepak.science:2222/physics/pdme/commit/e72489f0cb6586756180c2021649f4eb019c77fc))
|
||||
* adds fast nonlocal noise Sij calculator ([5fbff2a](https://gitea.deepak.science:2222/physics/pdme/commit/5fbff2a5c0f128ffc5b749788c8bdcd6f88de234))
|
||||
* adds methods for better creation of input lists, including pairs ([852836b](https://gitea.deepak.science:2222/physics/pdme/commit/852836b924c8ffefd6b28a8ea1bc1ca47b77756e))
|
||||
* adds pair inputs to array function ([a7508b8](https://gitea.deepak.science:2222/physics/pdme/commit/a7508b8906923a579dfa05edc22963d2f0102be9))
|
||||
|
||||
### [0.5.4](https://gitea.deepak.science:2222/physics/pdme/compare/0.5.3...0.5.4) (2022-03-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* lets you get model from discretisation for fixed magnitude models in type hintable way ([548dcfe](https://gitea.deepak.science:2222/physics/pdme/commit/548dcfebfc7cd6354ad708b3ab0e664881c58de4))
|
||||
|
||||
### [0.5.3](https://gitea.deepak.science:2222/physics/pdme/compare/0.5.2...0.5.3) (2022-03-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Adds between utility function ([a782b49](https://gitea.deepak.science:2222/physics/pdme/commit/a782b4957f2aebfb0bf9a3c7d4166277a5450b76))
|
||||
* Adds fast calc expressions ([0855911](https://gitea.deepak.science:2222/physics/pdme/commit/08559110be197b7f4a685d5e44e248f914853a3c))
|
||||
* Adds numpy make more dipoles at once and converters ([c70a971](https://gitea.deepak.science:2222/physics/pdme/commit/c70a971ce09bda236a84cfcff309d9a9cf2092d9))
|
||||
* Calculates range measurements. ([2d773df](https://gitea.deepak.science:2222/physics/pdme/commit/2d773df7259378ba9285776407b2cb5ae380d809))
|
||||
|
||||
### [0.5.2](https://gitea.deepak.science:2222/physics/pdme/compare/0.5.1...0.5.2) (2022-03-06)
|
||||
|
||||
### [0.5.1](https://gitea.deepak.science:2222/physics/pdme/compare/0.5.0...0.5.1) (2022-03-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixes typo ([31762de](https://gitea.deepak.science:2222/physics/pdme/commit/31762de69785b9c25704605b132c52036ad6dad3))
|
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -4,7 +4,7 @@ pipeline {
|
||||
label 'pdme' // all your pods will be named with this prefix, followed by a unique id
|
||||
idleMinutes 5 // how long the pod will live after no jobs have run on it
|
||||
yamlFile 'jenkins/ci-agent-pod.yaml' // path to the pod definition relative to the root of our project
|
||||
defaultContainer 'python' // define a default container if more than a few stages use it, will default to jnlp container
|
||||
defaultContainer 'poetry' // define a default container if more than a few stages use it, will default to jnlp container
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,36 +12,30 @@ pipeline {
|
||||
parallelsAlwaysFailFast()
|
||||
}
|
||||
|
||||
environment {
|
||||
POETRY_HOME="/opt/poetry"
|
||||
POETRY_VERSION="1.1.12"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Building...'
|
||||
sh 'python --version'
|
||||
sh 'curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python'
|
||||
sh '${POETRY_HOME}/bin/poetry --version'
|
||||
sh '${POETRY_HOME}/bin/poetry install'
|
||||
sh 'poetry --version'
|
||||
sh 'poetry install'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
parallel{
|
||||
stage('pytest') {
|
||||
steps {
|
||||
sh '${POETRY_HOME}/bin/poetry run pytest'
|
||||
sh 'poetry run pytest'
|
||||
}
|
||||
}
|
||||
stage('lint') {
|
||||
steps {
|
||||
sh '${POETRY_HOME}/bin/poetry run flake8 pdme tests'
|
||||
sh 'poetry run flake8 pdme tests'
|
||||
}
|
||||
}
|
||||
stage('mypy') {
|
||||
steps {
|
||||
sh '${POETRY_HOME}/bin/poetry run mypy pdme'
|
||||
sh 'poetry run mypy pdme'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -57,7 +51,7 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
echo 'Deploying...'
|
||||
sh '${POETRY_HOME}/bin/poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build'
|
||||
sh 'poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build'
|
||||
}
|
||||
}
|
||||
|
||||
|
15
README.md
15
README.md
@ -1 +1,16 @@
|
||||
# pdme - the python dipole model evaluator
|
||||
|
||||
[](https://conventionalcommits.org)
|
||||
[](https://pypi.org/project/pdme/)
|
||||
[](https://jenkins.deepak.science/job/gitea-physics/job/pdme/job/master/)
|
||||

|
||||

|
||||

|
||||
|
||||
This repo has library code for evaluating dipole models.
|
||||
|
||||
## Getting started
|
||||
|
||||
`poetry install` to start locally
|
||||
|
||||
Commit using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), and when commits are on master, release with `doo release`.
|
||||
|
5029
diagnosis1.nb
5029
diagnosis1.nb
File diff suppressed because it is too large
Load Diff
29
do.sh
29
do.sh
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Do - The Simplest Build Tool on Earth.
|
||||
# Documentation and examples see https://github.com/8gears/do
|
||||
|
||||
set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors"
|
||||
|
||||
build() {
|
||||
echo "I am ${FUNCNAME[0]}ing"
|
||||
poetry build
|
||||
}
|
||||
|
||||
test() {
|
||||
echo "I am ${FUNCNAME[0]}ing"
|
||||
poetry run flake8 pdme tests
|
||||
poetry run mypy pdme
|
||||
poetry run pytest
|
||||
}
|
||||
|
||||
htmlcov() {
|
||||
poetry run pytest --cov-report=html
|
||||
}
|
||||
|
||||
all() {
|
||||
build && test
|
||||
}
|
||||
|
||||
"$@" # <- execute the task
|
||||
|
||||
[ "$#" -gt 0 ] || printf "Usage:\n\t./do.sh %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"
|
95
flake.lock
generated
Normal file
95
flake.lock
generated
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1648297722,
|
||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"locked": {
|
||||
"lastModified": 1653893745,
|
||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1648854265,
|
||||
"narHash": "sha256-e/RlfodBOMr2SH9diDPYMraTWvhOWSSsXDQikHFdUvM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e194871435cad8ffb1d64b64fb7df3b2b8a10088",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e194871435cad8ffb1d64b64fb7df3b2b8a10088",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1655043425,
|
||||
"narHash": "sha256-A+oT+aQGhW5lXy8H0cqBLsYtgcnT5glmGOXWQDcGw6I=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "914ef51ffa88d9b386c71bdc88bffc5273c08ada",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"poetry2nix": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1654921554,
|
||||
"narHash": "sha256-hkfMdQAHSwLWlg0sBVvgrQdIiBP45U1/ktmFpY4g2Mo=",
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"rev": "7b71679fa7df00e1678fc3f1d1d4f5f372341b63",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "poetry2nix",
|
||||
"rev": "7b71679fa7df00e1678fc3f1d1d4f5f372341b63",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"poetry2nix": "poetry2nix"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
55
flake.nix
Normal file
55
flake.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
description = "Application packaged using poetry2nix";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils?rev=0f8662f1319ad6abf89b3380dd2722369fc51ade";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=e194871435cad8ffb1d64b64fb7df3b2b8a10088";
|
||||
inputs.poetry2nix.url = "github:nix-community/poetry2nix?rev=7b71679fa7df00e1678fc3f1d1d4f5f372341b63";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
||||
{
|
||||
# Nixpkgs overlay providing the application
|
||||
overlay = nixpkgs.lib.composeManyExtensions [
|
||||
poetry2nix.overlay
|
||||
(final: prev: {
|
||||
# The application
|
||||
pdme = prev.poetry2nix.mkPoetryApplication {
|
||||
overrides = [
|
||||
prev.poetry2nix.defaultPoetryOverrides
|
||||
];
|
||||
projectDir = ./.;
|
||||
};
|
||||
pdmeEnv = prev.poetry2nix.mkPoetryEnv {
|
||||
overrides = [
|
||||
prev.poetry2nix.defaultPoetryOverrides
|
||||
];
|
||||
projectDir = ./.;
|
||||
};
|
||||
})
|
||||
];
|
||||
} // (flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ self.overlay ];
|
||||
};
|
||||
in
|
||||
{
|
||||
apps = {
|
||||
pdme = pkgs.pdme;
|
||||
};
|
||||
|
||||
defaultApp = pkgs.pdme;
|
||||
devShell = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.poetry
|
||||
pkgs.pdmeEnv
|
||||
pkgs.pdme
|
||||
];
|
||||
shellHook = ''
|
||||
export DO_NIX_CUSTOM=1
|
||||
'';
|
||||
packages = [ pkgs.nodejs-16_x pkgs.gnupg ];
|
||||
};
|
||||
|
||||
}));
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
spec:
|
||||
imagePullSecrets:
|
||||
- name: regcreds
|
||||
containers: # list of containers that you want present for your build, you can define a default container in the Jenkinsfile
|
||||
- name: python
|
||||
image: python:3.8
|
||||
- name: poetry
|
||||
image: ghcr.io/dmallubhotla/poetry-image:1
|
||||
command: ["tail", "-f", "/dev/null"] # this or any command that is bascially a noop is required, this is so that you don't overwrite the entrypoint of the base container
|
||||
imagePullPolicy: Always # use cache or pull image for agent
|
||||
resources: # limits the resources your build contaienr
|
||||
|
64
justfile
Normal file
64
justfile
Normal file
@ -0,0 +1,64 @@
|
||||
|
||||
# execute default build
|
||||
default: build
|
||||
|
||||
# builds the python module using poetry
|
||||
build:
|
||||
echo "building..."
|
||||
poetry build
|
||||
|
||||
# print a message displaying whether nix is being used
|
||||
checknix:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
if [[ "${DO_NIX_CUSTOM:=0}" -eq 1 ]]; then
|
||||
echo "In an interactive nix env."
|
||||
else
|
||||
echo "Using poetry as runner, no nix detected."
|
||||
fi
|
||||
|
||||
# run all tests
|
||||
test: fmt
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
|
||||
if [[ "${DO_NIX_CUSTOM:=0}" -eq 1 ]]; then
|
||||
echo "testing, using nix..."
|
||||
flake8 pdme tests
|
||||
mypy pdme
|
||||
pytest
|
||||
else
|
||||
echo "testing..."
|
||||
poetry run flake8 pdme tests
|
||||
poetry run mypy pdme
|
||||
poetry run pytest
|
||||
fi
|
||||
|
||||
# update all test snapshots, use if snapshots are out of date
|
||||
update-snapshots:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
if [[ "${DO_NIX_CUSTOM:=0}" -eq 1 ]]; then
|
||||
pytest --snapshot-update
|
||||
else
|
||||
poetry run pytest --snapshot-update
|
||||
fi
|
||||
|
||||
# format code
|
||||
fmt:
|
||||
#!/usr/bin/env bash
|
||||
set -euxo pipefail
|
||||
if [[ "${DO_NIX_CUSTOM:=0}" -eq 1 ]]; then
|
||||
black .
|
||||
else
|
||||
poetry run black .
|
||||
fi
|
||||
find pdme -type f -name "*.py" -exec sed -i -e 's/ /\t/g' {} \;
|
||||
find tests -type f -name "*.py" -exec sed -i -e 's/ /\t/g' {} \;
|
||||
|
||||
# release the app, checking that our working tree is clean and ready for release
|
||||
release:
|
||||
./scripts/release.sh
|
||||
|
||||
htmlcov:
|
||||
poetry run pytest --cov-report=html
|
@ -1,101 +0,0 @@
|
||||
"dipole_mom","dipole_loc","dipole_freq","low_success","low_count","medium_success","medium_count","high_success","high_count"
|
||||
"(-8.394403299734375, -2.741796202195128, -4.607934528693184)","(0.6990690716183998, -8.96155114863804, 3.798412465313307)","1","2937","13500","2899","13500","2682","13500"
|
||||
"(1.859825234524071, -4.631346659179552, -5.493691917527049)","(4.345196905355175, 9.376641059442004, 4.21787361713405)","2","594","13500","534","13500","542","13500"
|
||||
"(-3.9422518774752704, -4.20151424266108, -5.609282080482728)","(-7.511885166861076, 6.185469949366215, 4.18551101584637)","3","6879","13500","6986","13500","7058","13500"
|
||||
"(-3.6651359764720888, 4.361287683238619, -0.4977129832528774)","(1.1222657169816141, 6.729626399116107, 4.4190410710812715)","4","914","13500","896","13500","816","13500"
|
||||
"(5.4983834576655415, -5.149555721727474, -2.9059322478486402)","(1.9839470252872733, 1.4497555695501845, 4.341665613269578)","5","64","13500","58","13500","6","13500"
|
||||
"(-2.6694049149389856, -8.996704004458167, -1.886496379233655)","(-3.3167277852261234, -0.20349702062781816, 3.612093006422956)","6","234","13500","310","13500","208","13500"
|
||||
"(-6.254663819409533, -5.17685615774952, -1.5795535534851701)","(6.579193043996991, 3.2559058012111706, 3.945482294020141)","7","184","13500","232","13500","206","13500"
|
||||
"(-2.3965267421857805, -0.1426781261324307, 2.726095696980245)","(9.812730489596689, 5.655333946553924, 3.811001888246572)","8","7126","13500","7171","13500","7207","13500"
|
||||
"(1.6355032955738602, 3.06789745500179, -1.2813116242722953)","(-6.170953785796478, -6.01469707093945, 4.291160187272589)","9","2248","13500","2600","13500","3060","13500"
|
||||
"(4.701041346434566, -4.598509019375965, -0.9430843236669983)","(5.696471338191589, 7.49904919567571, 4.493589702763421)","10","1004","13500","1100","13500","1298","13500"
|
||||
"(-4.723993570264787, 1.13293746497593, 8.520960982794042)","(6.961487895455377, 8.015424617689195, 3.5854967593904394)","11","1138","13500","1213","13500","1454","13500"
|
||||
"(-5.760613247404216, 7.081750697436045, -0.9919946387539863)","(-4.937652187684451, -1.5061643772297089, 4.31540612670304)","12","862","13500","946","13500","936","13500"
|
||||
"(3.528819362420093, -2.392856476308712, -7.4342903162298075)","(-4.099422078022544, -9.325040195505101, 4.116705744539639)","13","6860","13500","6791","13500","6743","13500"
|
||||
"(-0.9100683062008937, -5.783785114000128, 7.174017658154602)","(-0.8802975115483811, -8.671075713094933, 4.469813699926449)","14","944","13500","1036","13500","1026","13500"
|
||||
"(-5.383065244258856, 4.520588452647939, -5.935042401267746)","(-0.9939953179241243, 0.13066179695765712, 4.4279335798663375)","15","84","13500","68","13500","16","13500"
|
||||
"(-2.6540804654577674, 2.546919220535922, 5.375707698483995)","(5.113886482738877, -8.262301262617369, 3.782907179152329)","16","7287","13500","7523","13500","7558","13500"
|
||||
"(4.222005887886027, 7.538188681602292, 4.203854740545428)","(6.161028049055869, -3.830321784906346, 4.415709125389534)","17","7067","13500","7176","13500","7102","13500"
|
||||
"(-3.15644606460527, -5.329707083106276, 2.704961488260325)","(7.814569971693082, -0.038088373454183255, 3.8303790864319467)","18","6935","13500","7067","13500","6915","13500"
|
||||
"(-7.277680598922026, -2.8253329583318503, -1.148288512550368)","(6.64211537129362, -2.8241872160777515, 4.179539167210859)","19","770","13500","650","13500","638","13500"
|
||||
"(3.1745827237839337, 5.518221007264731, -7.056298214409336)","(1.5880359702992592, -1.2346860578604417, 4.436949897452313)","20","100","13500","82","13500","46","13500"
|
||||
"(-3.9837603828381702, -3.846190531568091, -3.5593740442996795)","(3.2092960126960115, 4.456520065762797, 4.203158185013188)","21","203","13500","216","13500","128","13500"
|
||||
"(-5.291919196376568, -4.249710093481788, -5.41303840771628)","(-2.333790415760671, 7.360548507835652, 3.5111631503401046)","22","564","13500","546","13500","531","13500"
|
||||
"(1.2458153060249753, 7.285596076781913, -4.53422433697739)","(-8.15438321990017, -5.813953704541877, 4.418252724499716)","23","1664","13500","1980","13500","2186","13500"
|
||||
"(-2.76355115227314, 6.775125299326909, -6.640665328863606)","(5.690574170252958, -1.258691301412897, 3.752101613890688)","24","158","13500","88","13500","22","13500"
|
||||
"(1.8897283340066036, 5.156980917794623, 7.678890379129224)","(-3.928088425987828, -3.497894081082964, 4.00856554264863)","25","6943","13500","6914","13500","7039","13500"
|
||||
"(2.996793991100871, -2.8556774859407885, -2.682394270029828)","(-4.392126208256959, -6.247175829109802, 3.78844055203133)","26","6793","13500","6902","13500","6959","13500"
|
||||
"(-5.873978570478022, -0.10810489863611472, 0.4098010277826613)","(-4.853374215182544, -0.3392936906512656, 3.7593793553619723)","27","768","13500","660","13500","792","13500"
|
||||
"(-1.2295157619602355, -0.9533043498271472, -5.013711684351103)","(4.966969478507568, -6.419739155898332, 4.478955364511799)","28","1376","13500","1502","13500","1602","13500"
|
||||
"(3.3280216682561172, -4.776470388412108, 5.933408931329477)","(5.225791261735759, -8.039947873883346, 4.330950095994171)","29","1092","13500","1308","13500","1242","13500"
|
||||
"(-1.1524820483113067, 3.3676199968222007, -6.447244985319373)","(-3.365698825669843, -7.823544190252827, 4.480522584086504)","30","1674","13500","1894","13500","2126","13500"
|
||||
"(6.847631825724908, -3.116108950640111, -2.002158728592441)","(-7.904883078822682, 5.770241516729497, 4.270246360901788)","31","988","13500","1292","13500","1264","13500"
|
||||
"(3.9865601226955723, -3.0741490528970163, -4.832637220059177)","(1.3517585394059228, -9.1219650648347, 3.6823641932717632)","32","7112","13500","6969","13500","6805","13500"
|
||||
"(-4.168472035652406, 7.5436496450903405, -0.5164567657273467)","(-9.617107958140203, -7.309157826802306, 4.157793979823828)","33","6813","13500","6829","13500","6860","13500"
|
||||
"(-7.130664999984266, 3.512218953469125, -5.583614013534945)","(4.179987195263603, -4.183435235616068, 3.614381766035873)","34","244","13500","280","13500","204","13500"
|
||||
"(7.538427135433331, -3.5572143126707263, -0.26483482537195546)","(8.253356046670937, -9.898966991838146, 3.8605154018150443)","35","1666","13500","1876","13500","2072","13500"
|
||||
"(1.9288772655422912, 1.5217637197923253, -6.739166923455718)","(-2.8799191263313535, -8.725965841587369, 4.178227225866321)","36","1535","13500","1718","13500","1894","13500"
|
||||
"(-4.401939293279974, -3.2679352541805873, -1.9376303031813007)","(-3.760493654473633, -8.242070700424623, 4.014630073607101)","37","1472","13500","1721","13500","1892","13500"
|
||||
"(-6.571860637992528, -3.001285279708493, -2.4189645938547493)","(-1.236006979567179, -4.918408248041544, 4.105303056705809)","38","1037","13500","1260","13500","1328","13500"
|
||||
"(0.12893833267327193, -4.517038390272907, -4.97294839023136)","(-0.4656256141433772, -3.427795875927524, 4.128710261159359)","39","6952","13500","7002","13500","7027","13500"
|
||||
"(-5.395484737831286, -0.983130424414826, -6.687400367838399)","(-4.636459920255181, 0.879777685208305, 4.4115666235036715)","40","6824","13500","6885","13500","6982","13500"
|
||||
"(1.1052486235353642, -4.848005335584978, 4.444566494630194)","(6.715481192778075, -5.496626668472939, 3.749176582170214)","41","1044","13500","1180","13500","1140","13500"
|
||||
"(3.4396532893962966, 2.4244648831845432, -5.01800325658646)","(4.6253825225794785, 3.241475704745687, 3.8161137388201345)","42","454","13500","507","13500","403","13500"
|
||||
"(-2.9673084148083073, -2.7534207120463443, -0.706528322977137)","(-7.295196867765608, -6.401732771415414, 3.8698371015791455)","43","1230","13500","1351","13500","1447","13500"
|
||||
"(3.5506751406943238, -7.856406429458245, 2.0724666779936665)","(3.1898686816835813, 7.275084177104713, 4.346027994595675)","44","744","13500","815","13500","801","13500"
|
||||
"(-2.396204146370333, -5.998435359160176, -4.998623697255808)","(1.1665571546012643, 8.267833275315375, 4.173114274965431)","45","367","13500","408","13500","504","13500"
|
||||
"(1.988088481074339, -0.952243420387878, -3.404987244985684)","(9.953863468920868, -2.373172232569898, 3.504634155967552)","46","7184","13500","7049","13500","6962","13500"
|
||||
"(-6.728913003593054, 5.7217519132626125, -0.6690269690352655)","(-4.638855214223117, 9.017697951962987, 4.433586136875334)","47","912","13500","1078","13500","1193","13500"
|
||||
"(0.898412621413605, 2.858927126961118, 3.3694271431239726)","(-3.342141091313138, -5.630726049638435, 3.73650780111009)","48","7187","13500","7290","13500","7229","13500"
|
||||
"(-4.532234703677105, -4.274810399777949, -3.875725349182983)","(1.2854542050944335, 9.187804568807472, 4.278167547669827)","49","865","13500","902","13500","886","13500"
|
||||
"(-2.5689769316463194, -1.8983472453072585, 3.400960267325491)","(4.420409550028877, 6.339428635077837, 3.507587100931773)","50","6930","13500","6833","13500","6727","13500"
|
||||
"(5.343718990507927, 4.225982487874972, 4.675760951571134)","(3.7608976931931615, -0.4286749518482651, 3.527434893715424)","51","80","13500","40","13500","0","13500"
|
||||
"(-2.551777030060732, -4.409473516507138, -3.335118150104721)","(2.255465115045981, -2.3409749124123884, 3.9759224218217972)","52","6872","13500","7017","13500","6905","13500"
|
||||
"(-6.178923654135948, -4.760036193191251, -5.410807156738262)","(8.993977697098511, 8.409205411107877, 3.9811679532170974)","53","786","13500","852","13500","787","13500"
|
||||
"(-0.7298002025690966, 0.7884321084844347, -0.6280373581218569)","(2.4081697361903878, -5.016575360843909, 4.187585237315533)","54","7065","13500","7077","13500","6838","13500"
|
||||
"(2.558836675421778, 5.575561955404615, 2.3323944563487964)","(2.3760611879398432, 0.7062206905749697, 4.23896173543061)","55","164","13500","148","13500","64","13500"
|
||||
"(7.526430818374149, -2.017762338198632, 5.175810339407134)","(3.1078893011499513, 4.725685474957995, 3.7762756750165543)","56","148","13500","126","13500","50","13500"
|
||||
"(-4.340247971586856, -6.098349014648726, -5.45622649731017)","(-3.085408520301227, 3.7565606075975406, 3.976611517346405)","57","420","13500","436","13500","382","13500"
|
||||
"(5.531731081428806, 0.2870394583279482, -3.170146934158759)","(-8.108136962700938, -6.317688772333696, 4.33873285840947)","58","1326","13500","1438","13500","1617","13500"
|
||||
"(3.9256796177101525, 3.6998712352720458, -3.0900044778897793)","(-1.795877310233271, 9.422404286696526, 4.405996996954238)","59","7152","13500","7193","13500","7153","13500"
|
||||
"(-2.169395880745919, 7.5508524539653, -3.717223424236534)","(0.24323803009268907, -6.874228916716378, 4.24742490188323)","60","917","13500","1096","13500","1019","13500"
|
||||
"(-6.669714278343257, -5.147443185028839, 4.137635234651696)","(-8.430180257973841, -2.0140469957812908, 4.235348624313792)","61","1232","13500","1438","13500","1630","13500"
|
||||
"(-0.3593168231009633, -2.1117351165304554, -2.756108902846217)","(-1.8782340680728904, 1.4613848889895227, 4.343762312734049)","62","717","13500","770","13500","698","13500"
|
||||
"(0.9983936769481018, 4.188023832441788, -5.9331456363477955)","(0.8944912321349978, -6.776488809453928, 3.887547488457294)","63","1158","13500","1266","13500","1206","13500"
|
||||
"(2.214994253682965, -6.894913418212955, 4.758359046752466)","(1.1738589158380108, -2.5838588695142573, 4.440114651140596)","64","189","13500","242","13500","116","13500"
|
||||
"(-2.658319675750278, -0.6584675782558327, -2.7431885267559846)","(2.431658445736012, -4.567490516161101, 4.238378174842468)","65","6672","13500","6621","13500","6540","13500"
|
||||
"(-6.115545061618803, -7.705430834184344, -0.6220594474800761)","(7.8444120516866676, -2.6359598241399285, 3.6573003062135934)","66","6713","13500","6809","13500","6763","13500"
|
||||
"(3.6172075804508106, -1.9284195561088269, 5.555689450608144)","(-6.548188677428666, -0.19032549890035888, 3.5175694382538767)","67","6829","13500","6951","13500","6955","13500"
|
||||
"(-9.15488421523017, 0.2200324094763304, 2.670522675374402)","(5.714040628321273, 8.26094993874144, 4.418820286217649)","68","1302","13500","1366","13500","1480","13500"
|
||||
"(0.6137958704382189, 5.425851817261803, 0.6869058196054374)","(-6.51011885452384, -7.481604965018793, 3.794739192743144)","69","7295","13500","7487","13500","7444","13500"
|
||||
"(1.8319902089796716, -1.7052093525364755, -1.5357432780633788)","(-3.9924181152346927, 7.510980653555592, 3.7418052192222016)","70","1383","13500","1544","13500","1648","13500"
|
||||
"(1.5562306000284276, 3.024132658533559, 3.661586103212843)","(-0.7385679794324034, -6.539530438463801, 4.284811834925752)","71","7111","13500","7184","13500","7205","13500"
|
||||
"(-6.1074620301655465, 5.384039657771404, -2.225649245224208)","(-2.608510581490675, -6.922625923425592, 3.971388620225418)","72","5418","13500","5598","13500","5587","13500"
|
||||
"(-2.8693186242377386, 3.908148411239099, 6.447553912002863)","(-6.143798646105374, -1.6029871965117515, 3.77795706478234)","73","1556","13500","1730","13500","1768","13500"
|
||||
"(-3.0254363994984104, 2.2450791278158357, 6.143327369483291)","(0.8544434777428229, 4.255347460313017, 3.7262914176120185)","74","136","13500","46","13500","6","13500"
|
||||
"(-5.458497976646368, 1.9668922250151184, -6.075598564484432)","(-8.918431896435788, -2.208767649326047, 4.433799571234449)","75","7243","13500","7225","13500","7183","13500"
|
||||
"(1.8746483443977506, -4.918359592579003, -5.153505125723421)","(9.712029704918773, 9.307277045929784, 4.370109835098039)","76","7029","13500","6952","13500","6981","13500"
|
||||
"(2.439241459895718, -1.0479850240226736, -8.979891784871686)","(-5.966228557046442, -7.645022694606578, 4.358305265022214)","77","7170","13500","7182","13500","6935","13500"
|
||||
"(-5.222878892836496, 3.6453173981381193, -4.7705449483482045)","(-5.032838059471385, -8.291748530973367, 4.3869919376089825)","78","6959","13500","6873","13500","6700","13500"
|
||||
"(-6.47940518306738, -4.236610566236078, 0.7683351361269996)","(-7.82483442691386, 4.134181541913014, 3.880527385212646)","79","1450","13500","1603","13500","1802","13500"
|
||||
"(-2.9370830024468453, -4.841258132022557, -4.13134185227759)","(6.040439892028971, 0.973553096817179, 3.5140698438190956)","80","294","13500","330","13500","196","13500"
|
||||
"(-2.3663116097696633, -4.855499659383513, 1.9920107402669622)","(3.701387712409323, -7.251501600742678, 3.7350101289391846)","81","1393","13500","1601","13500","1777","13500"
|
||||
"(-2.6554273437321587, 8.604888570531829, 2.537614705213776)","(0.754765294150932, -9.150595050904665, 4.008176571132182)","82","1576","13500","1908","13500","2016","13500"
|
||||
"(4.950050236685688, -8.021202942232057, 0.2997741256000333)","(6.285766477652878, 1.8889358463078914, 4.407003270314806)","83","621","13500","567","13500","563","13500"
|
||||
"(-4.084843741486609, -3.737834534080842, 5.388072062900191)","(-2.506641153953675, -5.2024956197613985, 3.8961280924068586)","84","987","13500","1104","13500","958","13500"
|
||||
"(2.7022073337770247, 1.4669450534672248, 2.368918032019529)","(-5.320569318247525, -6.475127062204049, 3.5226105324764565)","85","7249","13500","7360","13500","7318","13500"
|
||||
"(-0.3252592708970592, 4.932671097600122, 6.969504147283133)","(-9.93821168899215, -9.70079963475144, 4.209934587817141)","86","7218","13500","7119","13500","7100","13500"
|
||||
"(4.957041136462486, 1.121830218484448, -3.075537364565216)","(-4.796921784516219, -6.198583012473325, 3.9577741666058315)","87","1358","13500","1548","13500","1615","13500"
|
||||
"(-2.1633274817411947, 6.364818529028748, -4.9859713758133735)","(5.626262869068315, 0.23992608330854637, 3.842386945621137)","88","228","13500","206","13500","128","13500"
|
||||
"(-1.8400731012816351, 6.390246923942479, 6.937635436333114)","(2.1580547201887654, 2.5245118516402485, 3.6117392282117287)","89","48","13500","0","13500","0","13500"
|
||||
"(2.3937359541046326, -1.7120252930993696, -5.05220751953877)","(2.1774520632957035, -0.8110069037103713, 3.6615872998316745)","90","224","13500","116","13500","30","13500"
|
||||
"(-0.4504382167149993, 8.124824787338, -4.092849891229395)","(7.892513869349958, -7.457278776211231, 4.3351821499647825)","91","1338","13500","1502","13500","1806","13500"
|
||||
"(-1.819257909626675, -1.1955206008300214, 2.956331873988274)","(7.51918900289127, -2.3867986983196214, 4.385700405852607)","92","6799","13500","6849","13500","6831","13500"
|
||||
"(-3.4532614486999793, -2.891892725175883, 1.857631909826914)","(-5.4121256059850475, 6.738434705814861, 3.6136158029208403)","93","6993","13500","6870","13500","6883","13500"
|
||||
"(-2.0681371667599993, -1.291636366362397, -0.14161278068545158)","(-7.863635827591322, 9.387617521625195, 3.6452585970797706)","94","7081","13500","7062","13500","7030","13500"
|
||||
"(-5.557111642298841, 1.267535343152038, 3.647424212634726)","(-0.49848336551427685, -9.198509190171187, 3.762486028795368)","95","6979","13500","7153","13500","7000","13500"
|
||||
"(-2.61306248718091, 4.639212355850336, -4.893563723863182)","(3.5047210502681168, 0.4605123046644053, 3.858019617659242)","96","120","13500","68","13500","24","13500"
|
||||
"(-0.881598016467437, 2.041943869947487, 0.03471882691823845)","(-0.40799668695955305, -4.066009588196224, 3.5103370608640647)","97","7116","13500","7140","13500","6701","13500"
|
||||
"(-0.3867474477179286, -8.176602602762294, 1.4417058544771313)","(-9.13836167924802, 4.75969074092761, 4.074009275431829)","98","6837","13500","6823","13500","6742","13500"
|
||||
"(-3.936245090106337, -6.3731961312399354, -5.419640087611273)","(-8.411712473068793, 6.918676208391027, 3.8461565255620287)","99","6823","13500","6866","13500","6825","13500"
|
||||
"(3.051924711775824, -6.276447172511237, -0.09037163146027993)","(-8.886064716667534, 7.797749161418274, 3.5432018002900447)","100","1062","13500","1304","13500","1421","13500"
|
|
46
pdme/calculations/__init__.py
Normal file
46
pdme/calculations/__init__.py
Normal file
@ -0,0 +1,46 @@
|
||||
"""
|
||||
This module is a canonical source of the accurate expressions we want to use for calculating our noise.
|
||||
No reference to class or anything, just a straight set of math functions.
|
||||
"""
|
||||
import numpy
|
||||
|
||||
|
||||
def telegraph_beta(f: float, w: float) -> float:
|
||||
"""
|
||||
This function represents the frequency component of analytic telegraph noise.
|
||||
|
||||
We're assuming we care about the one-sided PSD where we are ignoring negative frequencies.
|
||||
This matches with experimental data from say Connors et al., and I think is better than keeping with one-sided.
|
||||
Note that this means that it will only be comparable then with time series data assuming one-sided!
|
||||
|
||||
Don't bikeshed yet, if we care about two-sided things for any reason down the line divide this by two or just change it then.
|
||||
"""
|
||||
return 2 * w / ((numpy.pi * f) ** 2 + w**2)
|
||||
|
||||
|
||||
def electric_potential(p: numpy.ndarray, s: numpy.ndarray, r: numpy.ndarray) -> float:
|
||||
"""
|
||||
Gives the electric potential of a defect with dipole moment p, located at position s,
|
||||
as measured from position r.
|
||||
|
||||
p, s, r, are numpy arrays of length 3
|
||||
"""
|
||||
diff = r - s
|
||||
return (p.dot(diff) / (numpy.linalg.norm(diff) ** 3)).item()
|
||||
|
||||
|
||||
def electric_field(
|
||||
p: numpy.ndarray, s: numpy.ndarray, r: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
Gives the electric field of a defect with dipole moment p, located at position s,
|
||||
as measured from position r.
|
||||
|
||||
p, s, r, are numpy arrays of length 3
|
||||
|
||||
Returns an array of length 3, ideally.
|
||||
"""
|
||||
diff = r - s
|
||||
norm_diff = numpy.linalg.norm(diff)
|
||||
|
||||
return ((3 * (p.dot(diff) * diff) / (norm_diff**2)) - p) / (norm_diff**3)
|
7
pdme/inputs/__init__.py
Normal file
7
pdme/inputs/__init__.py
Normal file
@ -0,0 +1,7 @@
|
||||
from pdme.inputs.dot_inputs import (
|
||||
inputs_with_frequency_range,
|
||||
input_pairs_with_frequency_range,
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["inputs_with_frequency_range", "input_pairs_with_frequency_range"]
|
21
pdme/inputs/dot_inputs.py
Normal file
21
pdme/inputs/dot_inputs.py
Normal file
@ -0,0 +1,21 @@
|
||||
import numpy
|
||||
import numpy.typing
|
||||
import itertools
|
||||
from typing import Sequence, Tuple
|
||||
|
||||
|
||||
def inputs_with_frequency_range(
|
||||
dots: Sequence[numpy.typing.ArrayLike], frequency_range: Sequence[float]
|
||||
) -> Sequence[Tuple[numpy.typing.ArrayLike, float]]:
|
||||
return list(itertools.chain(*[[(dot, f) for f in frequency_range] for dot in dots]))
|
||||
|
||||
|
||||
def input_pairs_with_frequency_range(
|
||||
dots: Sequence[numpy.typing.ArrayLike], frequency_range: Sequence[float]
|
||||
) -> Sequence[Tuple[numpy.typing.ArrayLike, numpy.typing.ArrayLike, float]]:
|
||||
all_pairs = itertools.combinations(dots, 2)
|
||||
return list(
|
||||
itertools.chain(
|
||||
*[[(dot1, dot2, f) for f in frequency_range] for (dot1, dot2) in all_pairs]
|
||||
)
|
||||
)
|
@ -1,4 +1,22 @@
|
||||
from pdme.measurement.dot_measure import DotMeasurement
|
||||
from pdme.measurement.oscillating_dipole import OscillatingDipole, OscillatingDipoleArrangement
|
||||
from pdme.measurement.dot_measure import DotMeasurement, DotRangeMeasurement
|
||||
from pdme.measurement.dot_pair_measure import (
|
||||
DotPairMeasurement,
|
||||
DotPairRangeMeasurement,
|
||||
)
|
||||
from pdme.measurement.oscillating_dipole import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
from pdme.measurement.input_types import DotInput, DotPairInput
|
||||
|
||||
__all__ = ['DotMeasurement', 'OscillatingDipole', 'OscillatingDipoleArrangement']
|
||||
|
||||
__all__ = [
|
||||
"DotMeasurement",
|
||||
"DotRangeMeasurement",
|
||||
"DotPairMeasurement",
|
||||
"DotPairRangeMeasurement",
|
||||
"OscillatingDipole",
|
||||
"OscillatingDipoleArrangement",
|
||||
"DotInput",
|
||||
"DotPairInput",
|
||||
]
|
||||
|
@ -4,22 +4,56 @@ import numpy.typing
|
||||
|
||||
|
||||
@dataclass
|
||||
class DotMeasurement():
|
||||
'''
|
||||
class DotMeasurement:
|
||||
"""
|
||||
Representation of a dot measuring oscillating dipoles.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
v : float
|
||||
The voltage measured at the dot.
|
||||
The voltage measured at the dot.
|
||||
|
||||
r : numpy.ndarray
|
||||
The position of the dot.
|
||||
The position of the dot.
|
||||
|
||||
f : float
|
||||
The measurement frequency.
|
||||
'''
|
||||
The measurement frequency.
|
||||
"""
|
||||
|
||||
v: float
|
||||
r: numpy.ndarray
|
||||
f: float
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self.r = numpy.array(self.r)
|
||||
|
||||
|
||||
@dataclass
|
||||
class DotRangeMeasurement:
|
||||
"""
|
||||
Representation of a dot measuring oscillating dipoles.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
v_low : float
|
||||
The lower range of voltage measured at the dot.
|
||||
|
||||
v_high : float
|
||||
The upper range of voltage measured at the dot.
|
||||
|
||||
r : numpy.ndarray
|
||||
The position of the dot.
|
||||
|
||||
f : float
|
||||
The measurement frequency.
|
||||
"""
|
||||
|
||||
v_low: float
|
||||
v_high: float
|
||||
r: numpy.ndarray
|
||||
f: float
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self.r = numpy.array(self.r)
|
||||
if self.v_low > self.v_high:
|
||||
self.v_low, self.v_high = self.v_high, self.v_low
|
||||
|
69
pdme/measurement/dot_pair_measure.py
Normal file
69
pdme/measurement/dot_pair_measure.py
Normal file
@ -0,0 +1,69 @@
|
||||
from dataclasses import dataclass
|
||||
import numpy
|
||||
import numpy.typing
|
||||
|
||||
|
||||
@dataclass
|
||||
class DotPairMeasurement:
|
||||
"""
|
||||
Representation of a dot measuring oscillating dipoles.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
v : float
|
||||
The voltage measured at the dot.
|
||||
|
||||
r1 : numpy.ndarray
|
||||
The position of the first dot.
|
||||
|
||||
r2 : numpy.ndarray
|
||||
The position of the second dot.
|
||||
|
||||
f : float
|
||||
The measurement frequency.
|
||||
"""
|
||||
|
||||
v: float
|
||||
r1: numpy.ndarray
|
||||
r2: numpy.ndarray
|
||||
f: float
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self.r1 = numpy.array(self.r1)
|
||||
self.r2 = numpy.array(self.r2)
|
||||
|
||||
|
||||
@dataclass
|
||||
class DotPairRangeMeasurement:
|
||||
"""
|
||||
Representation of a dot measuring oscillating dipoles.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
v_low : float
|
||||
The lower range of voltage measured at the dot.
|
||||
|
||||
v_high : float
|
||||
The upper range of voltage measured at the dot.
|
||||
|
||||
r1 : numpy.ndarray
|
||||
The position of the first dot.
|
||||
|
||||
r2 : numpy.ndarray
|
||||
The position of the second dot.
|
||||
|
||||
f : float
|
||||
The measurement frequency.
|
||||
"""
|
||||
|
||||
v_low: float
|
||||
v_high: float
|
||||
r1: numpy.ndarray
|
||||
r2: numpy.ndarray
|
||||
f: float
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self.r1 = numpy.array(self.r1)
|
||||
self.r2 = numpy.array(self.r2)
|
||||
if self.v_low > self.v_high:
|
||||
self.v_low, self.v_high = self.v_high, self.v_low
|
36
pdme/measurement/input_types.py
Normal file
36
pdme/measurement/input_types.py
Normal file
@ -0,0 +1,36 @@
|
||||
import numpy.typing
|
||||
from typing import Tuple, Sequence, Union
|
||||
from pdme.measurement.dot_measure import DotRangeMeasurement
|
||||
from pdme.measurement.dot_pair_measure import DotPairRangeMeasurement
|
||||
|
||||
|
||||
DotInput = Tuple[numpy.typing.ArrayLike, float]
|
||||
DotPairInput = Tuple[numpy.typing.ArrayLike, numpy.typing.ArrayLike, float]
|
||||
|
||||
|
||||
def dot_inputs_to_array(dot_inputs: Sequence[DotInput]) -> numpy.ndarray:
|
||||
return numpy.array(
|
||||
[numpy.append(numpy.array(input[0]), input[1]) for input in dot_inputs]
|
||||
)
|
||||
|
||||
|
||||
def dot_pair_inputs_to_array(pair_inputs: Sequence[DotPairInput]) -> numpy.ndarray:
|
||||
return numpy.array(
|
||||
[
|
||||
[
|
||||
numpy.append(numpy.array(input[0]), input[2]),
|
||||
numpy.append(numpy.array(input[1]), input[2]),
|
||||
]
|
||||
for input in pair_inputs
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
def dot_range_measurements_low_high_arrays(
|
||||
dot_range_measurements: Union[
|
||||
Sequence[DotRangeMeasurement], Sequence[DotPairRangeMeasurement]
|
||||
]
|
||||
) -> Tuple[numpy.ndarray, numpy.ndarray]:
|
||||
lows = [measurement.v_low for measurement in dot_range_measurements]
|
||||
highs = [measurement.v_high for measurement in dot_range_measurements]
|
||||
return (numpy.array(lows), numpy.array(highs))
|
@ -1,77 +1,267 @@
|
||||
from dataclasses import dataclass
|
||||
import numpy
|
||||
import numpy.typing
|
||||
from typing import Sequence, List, Tuple
|
||||
from pdme.measurement.dot_measure import DotMeasurement
|
||||
|
||||
|
||||
DotInput = Tuple[numpy.typing.ArrayLike, float]
|
||||
from typing import Sequence, List
|
||||
from pdme.measurement.dot_measure import DotMeasurement, DotRangeMeasurement
|
||||
from pdme.measurement.dot_pair_measure import (
|
||||
DotPairMeasurement,
|
||||
DotPairRangeMeasurement,
|
||||
)
|
||||
import pdme.calculations
|
||||
from pdme.measurement.input_types import DotInput, DotPairInput
|
||||
|
||||
|
||||
@dataclass
|
||||
class OscillatingDipole():
|
||||
'''
|
||||
Representation of an oscilltaing dipole, either known or guessed.
|
||||
class OscillatingDipole:
|
||||
"""
|
||||
Representation of an oscillating dipole, either known or guessed.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
p : numpy.ndarray
|
||||
The oscillating dipole moment, with overall sign arbitrary.
|
||||
The oscillating dipole moment, with overall sign arbitrary.
|
||||
|
||||
s : numpy.ndarray
|
||||
The position of the dipole.
|
||||
The position of the dipole.
|
||||
|
||||
w : float
|
||||
The oscillation frequency.
|
||||
'''
|
||||
The oscillation frequency.
|
||||
"""
|
||||
|
||||
p: numpy.ndarray
|
||||
s: numpy.ndarray
|
||||
w: float
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
'''
|
||||
"""
|
||||
Coerce the inputs into numpy arrays.
|
||||
'''
|
||||
"""
|
||||
self.p = numpy.array(self.p)
|
||||
self.s = numpy.array(self.s)
|
||||
|
||||
def s_at_position(self, r: numpy.ndarray, f: float) -> float:
|
||||
'''
|
||||
def _alpha_electric_potential(self, r: numpy.ndarray) -> float:
|
||||
"""
|
||||
Returns the electric potential of this dipole at position r.
|
||||
"""
|
||||
return pdme.calculations.electric_potential(self.p, self.s, r)
|
||||
|
||||
def _alpha_electric_field(self, r: numpy.ndarray) -> numpy.ndarray:
|
||||
"""
|
||||
Returns the electric field of this dipole at position r.
|
||||
"""
|
||||
return pdme.calculations.electric_field(self.p, self.s, r)
|
||||
|
||||
def _b(self, f: float) -> float:
|
||||
return pdme.calculations.telegraph_beta(f, self.w)
|
||||
|
||||
def s_electric_potential_at_position(self, r: numpy.ndarray, f: float) -> float:
|
||||
"""
|
||||
Returns the noise potential at a point r, at some frequency f.
|
||||
|
||||
Specifically for electric potential!
|
||||
|
||||
Parameters
|
||||
----------
|
||||
r : numpy.ndarray
|
||||
The position of the dot.
|
||||
The position of the dot.
|
||||
|
||||
f : float
|
||||
The dot frequency to sample.
|
||||
'''
|
||||
return (self._alpha(r))**2 * self._b(f)
|
||||
The dot frequency to sample.
|
||||
"""
|
||||
return (self._alpha_electric_potential(r)) ** 2 * self._b(f)
|
||||
|
||||
def _alpha(self, r: numpy.ndarray) -> float:
|
||||
diff = r - self.s
|
||||
return self.p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
def s_electric_potential_for_dot_pair(
|
||||
self, r1: numpy.ndarray, r2: numpy.ndarray, f: float
|
||||
) -> float:
|
||||
"""
|
||||
This is specifically the analytic cpsd for electric potential noise.
|
||||
This should be deprecated
|
||||
"""
|
||||
return (
|
||||
self._alpha_electric_potential(r1)
|
||||
* self._alpha_electric_potential(r2)
|
||||
* self._b(f)
|
||||
)
|
||||
|
||||
def _b(self, f: float) -> float:
|
||||
return (1 / numpy.pi) * (self.w / (f**2 + self.w**2))
|
||||
def s_electric_fieldx_at_position(self, r: numpy.ndarray, f: float) -> float:
|
||||
"""
|
||||
Returns the noise potential at a point r, at some frequency f.
|
||||
|
||||
Specifically for electric potential!
|
||||
|
||||
Parameters
|
||||
----------
|
||||
r : numpy.ndarray
|
||||
The position of the dot.
|
||||
|
||||
f : float
|
||||
The dot frequency to sample.
|
||||
"""
|
||||
return (self._alpha_electric_field(r)[0]) ** 2 * self._b(f)
|
||||
|
||||
def s_electric_fieldx_for_dot_pair(
|
||||
self, r1: numpy.ndarray, r2: numpy.ndarray, f: float
|
||||
) -> float:
|
||||
"""
|
||||
This is specifically the analytic cpsd for electric potential noise.
|
||||
This should be deprecated
|
||||
"""
|
||||
return (
|
||||
self._alpha_electric_field(r1)[0]
|
||||
* self._alpha_electric_field(r2)[0]
|
||||
* self._b(f)
|
||||
)
|
||||
|
||||
def to_flat_array(self) -> numpy.ndarray:
|
||||
return numpy.concatenate([self.p, self.s, numpy.array([self.w])])
|
||||
|
||||
|
||||
class OscillatingDipoleArrangement():
|
||||
'''
|
||||
class OscillatingDipoleArrangement:
|
||||
"""
|
||||
A collection of oscillating dipoles, which we are interested in being able to characterise.
|
||||
|
||||
Parameters
|
||||
--------
|
||||
dipoles : Sequence[OscillatingDipole]
|
||||
'''
|
||||
"""
|
||||
|
||||
def __init__(self, dipoles: Sequence[OscillatingDipole]):
|
||||
self.dipoles = dipoles
|
||||
|
||||
def get_dot_measurement(self, dot_input: DotInput) -> DotMeasurement:
|
||||
def get_potential_dot_measurement(self, dot_input: DotInput) -> DotMeasurement:
|
||||
r = numpy.array(dot_input[0])
|
||||
f = dot_input[1]
|
||||
return DotMeasurement(sum([dipole.s_at_position(r, f) for dipole in self.dipoles]), r, f)
|
||||
return DotMeasurement(
|
||||
sum(
|
||||
[
|
||||
dipole.s_electric_potential_at_position(r, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
r,
|
||||
f,
|
||||
)
|
||||
|
||||
def get_dot_measurements(self, dot_inputs: Sequence[DotInput]) -> List[DotMeasurement]:
|
||||
'''
|
||||
def get_potential_dot_pair_measurement(
|
||||
self, dot_pair_input: DotPairInput
|
||||
) -> DotPairMeasurement:
|
||||
r1 = numpy.array(dot_pair_input[0])
|
||||
r2 = numpy.array(dot_pair_input[1])
|
||||
f = dot_pair_input[2]
|
||||
return DotPairMeasurement(
|
||||
sum(
|
||||
[
|
||||
dipole.s_electric_potential_for_dot_pair(r1, r2, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
r1,
|
||||
r2,
|
||||
f,
|
||||
)
|
||||
|
||||
def get_potential_dot_measurements(
|
||||
self, dot_inputs: Sequence[DotInput]
|
||||
) -> List[DotMeasurement]:
|
||||
"""
|
||||
For a series of points, each with three coordinates and a frequency, return a list of the corresponding DotMeasurements.
|
||||
'''
|
||||
return [self.get_dot_measurement(dot_input) for dot_input in dot_inputs]
|
||||
"""
|
||||
return [
|
||||
self.get_potential_dot_measurement(dot_input) for dot_input in dot_inputs
|
||||
]
|
||||
|
||||
def get_potential_dot_pair_measurements(
|
||||
self, dot_pair_inputs: Sequence[DotPairInput]
|
||||
) -> List[DotPairMeasurement]:
|
||||
"""
|
||||
For a series of pairs of points, each with three coordinates and a frequency, return a list of the corresponding DotPairMeasurements.
|
||||
"""
|
||||
return [
|
||||
self.get_potential_dot_pair_measurement(dot_pair_input)
|
||||
for dot_pair_input in dot_pair_inputs
|
||||
]
|
||||
|
||||
def get_percent_range_potential_dot_measurement(
|
||||
self, dot_input: DotInput, low_percent: float, high_percent: float
|
||||
) -> DotRangeMeasurement:
|
||||
r = numpy.array(dot_input[0])
|
||||
f = dot_input[1]
|
||||
return DotRangeMeasurement(
|
||||
low_percent
|
||||
* sum(
|
||||
[
|
||||
dipole.s_electric_potential_at_position(r, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
high_percent
|
||||
* sum(
|
||||
[
|
||||
dipole.s_electric_potential_at_position(r, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
r,
|
||||
f,
|
||||
)
|
||||
|
||||
def get_percent_range_potential_dot_measurements(
|
||||
self, dot_inputs: Sequence[DotInput], low_percent: float, high_percent: float
|
||||
) -> List[DotRangeMeasurement]:
|
||||
"""
|
||||
For a series of pairs of points, each with three coordinates and a frequency, and also a lower error range and upper error range, return a list of the corresponding DotPairRangeMeasurements.
|
||||
"""
|
||||
return [
|
||||
self.get_percent_range_potential_dot_measurement(
|
||||
dot_input, low_percent, high_percent
|
||||
)
|
||||
for dot_input in dot_inputs
|
||||
]
|
||||
|
||||
def get_percent_range_potential_dot_pair_measurement(
|
||||
self, pair_input: DotPairInput, low_percent: float, high_percent: float
|
||||
) -> DotPairRangeMeasurement:
|
||||
r1 = numpy.array(pair_input[0])
|
||||
r2 = numpy.array(pair_input[1])
|
||||
f = pair_input[2]
|
||||
return DotPairRangeMeasurement(
|
||||
low_percent
|
||||
* sum(
|
||||
[
|
||||
dipole.s_electric_potential_for_dot_pair(r1, r2, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
high_percent
|
||||
* sum(
|
||||
[
|
||||
dipole.s_electric_potential_for_dot_pair(r1, r2, f)
|
||||
for dipole in self.dipoles
|
||||
]
|
||||
),
|
||||
r1,
|
||||
r2,
|
||||
f,
|
||||
)
|
||||
|
||||
def get_percent_range_potential_dot_pair_measurements(
|
||||
self,
|
||||
pair_inputs: Sequence[DotPairInput],
|
||||
low_percent: float,
|
||||
high_percent: float,
|
||||
) -> List[DotPairRangeMeasurement]:
|
||||
"""
|
||||
For a series of pairs of points, each with three coordinates and a frequency, and also a lower error range and upper error range, return a list of the corresponding DotPairRangeMeasurements.
|
||||
"""
|
||||
return [
|
||||
self.get_percent_range_potential_dot_pair_measurement(
|
||||
pair_input, low_percent, high_percent
|
||||
)
|
||||
for pair_input in pair_inputs
|
||||
]
|
||||
|
||||
def to_numpy_array(self) -> numpy.ndarray:
|
||||
"""
|
||||
Returns a numpy array with the canonical representation of each dipole in a nx7 numpy array.
|
||||
"""
|
||||
return numpy.array([dipole.to_flat_array() for dipole in self.dipoles])
|
||||
|
@ -1,3 +1,3 @@
|
||||
from importlib.metadata import version
|
||||
|
||||
__version__ = version('pdme')
|
||||
__version__ = version("pdme")
|
||||
|
@ -1,5 +1,30 @@
|
||||
from pdme.model.model import Model
|
||||
from pdme.model.fixed_z_plane_model import FixedZPlaneModel
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.model.fixed_magnitude_model import SingleDipoleFixedMagnitudeModel
|
||||
from pdme.model.multidipole_fixed_magnitude_model import (
|
||||
MultipleDipoleFixedMagnitudeModel,
|
||||
)
|
||||
from pdme.model.random_count_multidipole_fixed_magnitude_model import (
|
||||
RandomCountMultipleDipoleFixedMagnitudeModel,
|
||||
)
|
||||
|
||||
__all__ = ["Model", "FixedZPlaneModel", "UnrestrictedModel"]
|
||||
from pdme.model.log_spaced_random_choice_model import (
|
||||
LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel,
|
||||
)
|
||||
|
||||
from pdme.model.log_spaced_random_choice_xy_model import (
|
||||
LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel,
|
||||
)
|
||||
|
||||
from pdme.model.log_spaced_random_choice_fixed_orientation_model import (
|
||||
LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"DipoleModel",
|
||||
"SingleDipoleFixedMagnitudeModel",
|
||||
"MultipleDipoleFixedMagnitudeModel",
|
||||
"RandomCountMultipleDipoleFixedMagnitudeModel",
|
||||
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel",
|
||||
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeXYModel",
|
||||
"LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel",
|
||||
]
|
||||
|
@ -1,123 +0,0 @@
|
||||
import numpy
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence, Tuple
|
||||
import scipy.optimize
|
||||
from pdme.model.model import Model
|
||||
from pdme.measurement import DotMeasurement
|
||||
|
||||
|
||||
class FixedDipoleModel(Model):
|
||||
'''
|
||||
Model of oscillating dipole with a fixed dipole moment.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
p : numpy.ndarray
|
||||
The fixed dipole moment.
|
||||
n : int
|
||||
The number of dipoles to assume.
|
||||
'''
|
||||
def __init__(self, xmin: float, xmax: float, ymin: float, ymax: float, zmin: float, zmax: float, p: numpy.ndarray, n: int) -> None:
|
||||
self.xmin = xmin
|
||||
self.xmax = xmax
|
||||
self.ymin = ymin
|
||||
self.ymax = ymax
|
||||
self.zmin = zmin
|
||||
self.zmax = zmax
|
||||
self.p = p
|
||||
self._n = n
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'FixedDipoleModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.p}, {self.n()})'
|
||||
|
||||
def point_length(self) -> int:
|
||||
'''
|
||||
Dipole is constrained magnitude, but free orientation.
|
||||
Six degrees of freedom: (sx, sy, sz, w).
|
||||
'''
|
||||
return 4
|
||||
|
||||
def n(self) -> int:
|
||||
return self._n
|
||||
|
||||
def v_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> float:
|
||||
s = pt[0:3]
|
||||
w = pt[3]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = self.p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
return alpha**2 * b
|
||||
|
||||
def jac_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> numpy.ndarray:
|
||||
s = pt[0:3]
|
||||
w = pt[3]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = self.p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
|
||||
r_divs = (-self.p / (numpy.linalg.norm(diff)**3) + 3 * self.p.dot(diff) * diff / (numpy.linalg.norm(diff)**5)) * 2 * alpha * b
|
||||
|
||||
f2 = dot.f**2
|
||||
w2 = w**2
|
||||
|
||||
w_div = alpha**2 * (1 / numpy.pi) * ((f2 - w2) / ((f2 + w2)**2))
|
||||
|
||||
return numpy.concatenate((r_divs, w_div), axis=None)
|
||||
|
||||
|
||||
@dataclass
|
||||
class FixedDipoleDiscretisation():
|
||||
'''
|
||||
Representation of a discretisation of a FixedDipoleDiscretisation.
|
||||
Also captures a rough maximum value of dipole.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : FixedDipoleModel
|
||||
The parent model of the discretisation.
|
||||
num_x : int
|
||||
The number of partitions of the x axis.
|
||||
num_y : int
|
||||
The number of partitions of the y axis.
|
||||
num_z : int
|
||||
The number of partitions of the z axis.
|
||||
'''
|
||||
model: FixedDipoleModel
|
||||
num_x: int
|
||||
num_y: int
|
||||
num_z: int
|
||||
|
||||
def __post_init__(self):
|
||||
self.cell_count = self.num_x * self.num_y * self.num_z
|
||||
self.x_step = (self.model.xmax - self.model.xmin) / self.num_x
|
||||
self.y_step = (self.model.ymax - self.model.ymin) / self.num_y
|
||||
self.z_step = (self.model.zmax - self.model.zmin) / self.num_z
|
||||
|
||||
def bounds(self, index: Tuple[float, float, float]) -> Tuple:
|
||||
xi, yi, zi = index
|
||||
|
||||
# For this model, a point is (sx, sx, sy, w).
|
||||
# We want to keep w unbounded, restrict sx, sy, sz, px and py based on step.
|
||||
return (
|
||||
[
|
||||
xi * self.x_step + self.model.xmin, yi * self.y_step + self.model.ymin, zi * self.z_step + self.model.zmin,
|
||||
-numpy.inf
|
||||
],
|
||||
[
|
||||
(xi + 1) * self.x_step + self.model.xmin, (yi + 1) * self.y_step + self.model.ymin, (zi + 1) * self.z_step + self.model.zmin,
|
||||
numpy.inf
|
||||
]
|
||||
)
|
||||
|
||||
def all_indices(self) -> numpy.ndindex:
|
||||
# see https://github.com/numpy/numpy/issues/20706 for why this is a mypy problem.
|
||||
return numpy.ndindex((self.num_x, self.num_y, self.num_z)) # type:ignore
|
||||
|
||||
def solve_for_index(self, dots: Sequence[DotMeasurement], index: Tuple[float, float, float]) -> scipy.optimize.OptimizeResult:
|
||||
bounds = self.bounds(index)
|
||||
sx_mean = (bounds[0][0] + bounds[1][0]) / 2
|
||||
sy_mean = (bounds[0][1] + bounds[1][1]) / 2
|
||||
sz_mean = (bounds[0][2] + bounds[1][2]) / 2
|
||||
return self.model.solve(dots, initial_pt=numpy.array([sx_mean, sy_mean, sz_mean, .1]), bounds=bounds)
|
@ -1,23 +1,32 @@
|
||||
import numpy
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence, Tuple
|
||||
import scipy.optimize
|
||||
from pdme.model.model import Model
|
||||
from pdme.measurement import DotMeasurement
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
|
||||
|
||||
class FixedMagnitudeModel(Model):
|
||||
'''
|
||||
Model of oscillating dipole with a fixed magnitude, but free rotation.
|
||||
class SingleDipoleFixedMagnitudeModel(DipoleModel):
|
||||
"""
|
||||
Model of single oscillating dipole with a fixed magnitude, but free rotation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
pfixed : float
|
||||
The fixed dipole magnitude.
|
||||
n : int
|
||||
The number of dipoles to assume.
|
||||
'''
|
||||
def __init__(self, xmin: float, xmax: float, ymin: float, ymax: float, zmin: float, zmax: float, pfixed: float, n: int) -> None:
|
||||
The fixed dipole magnitude.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
xmin: float,
|
||||
xmax: float,
|
||||
ymin: float,
|
||||
ymax: float,
|
||||
zmin: float,
|
||||
zmax: float,
|
||||
pfixed: float,
|
||||
) -> None:
|
||||
self.xmin = xmin
|
||||
self.xmax = xmax
|
||||
self.ymin = ymin
|
||||
@ -25,138 +34,58 @@ class FixedMagnitudeModel(Model):
|
||||
self.zmin = zmin
|
||||
self.zmax = zmax
|
||||
self.pfixed = pfixed
|
||||
self._n = n
|
||||
self.rng = numpy.random.default_rng()
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'FixedMagnitudeModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.n()})'
|
||||
return f"SingleDipoleFixedMagnitudeModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.pfixed})"
|
||||
|
||||
def point_length(self) -> int:
|
||||
'''
|
||||
Dipole is constrained magnitude, but free orientation.
|
||||
Six degrees of freedom: (p_theta, p_phi, sx, sy, sz, w).
|
||||
'''
|
||||
return 6
|
||||
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
|
||||
|
||||
def n(self) -> int:
|
||||
return self._n
|
||||
|
||||
def v_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> float:
|
||||
p_theta = pt[0]
|
||||
p_phi = pt[1]
|
||||
s = pt[2:5]
|
||||
w = pt[5]
|
||||
|
||||
p = numpy.array([
|
||||
self.pfixed * numpy.sin(p_theta) * numpy.cos(p_phi),
|
||||
self.pfixed * numpy.sin(p_theta) * numpy.sin(p_phi),
|
||||
self.pfixed * numpy.cos(p_theta)
|
||||
])
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
return alpha**2 * b
|
||||
|
||||
def jac_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> numpy.ndarray:
|
||||
p_theta = pt[0]
|
||||
p_phi = pt[1]
|
||||
s = pt[2:5]
|
||||
w = pt[5]
|
||||
|
||||
p = numpy.array([
|
||||
self.pfixed * numpy.sin(p_theta) * numpy.cos(p_phi),
|
||||
self.pfixed * numpy.sin(p_theta) * numpy.sin(p_phi),
|
||||
self.pfixed * numpy.cos(p_theta)
|
||||
])
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
|
||||
theta_div_middle = self.pfixed * (
|
||||
diff[0] * numpy.cos(p_phi) * numpy.cos(p_theta)
|
||||
+ diff[1] * numpy.sin(p_phi) * numpy.cos(p_theta)
|
||||
- diff[2] * numpy.sin(p_theta)
|
||||
theta = numpy.arccos(rng.uniform(-1, 1))
|
||||
phi = rng.uniform(0, 2 * numpy.pi)
|
||||
px = self.pfixed * numpy.sin(theta) * numpy.cos(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(theta)
|
||||
s_pts = numpy.array(
|
||||
(
|
||||
rng.uniform(self.xmin, self.xmax),
|
||||
rng.uniform(self.ymin, self.ymax),
|
||||
rng.uniform(self.zmin, self.zmax),
|
||||
)
|
||||
)
|
||||
theta_div = 2 * alpha * (theta_div_middle) / (numpy.linalg.norm(diff)**3) * b
|
||||
|
||||
phi_div_middle = self.pfixed * (
|
||||
diff[1] * numpy.sin(p_theta) * numpy.cos(p_phi)
|
||||
- diff[0] * numpy.sin(p_theta) * numpy.sin(p_phi)
|
||||
)
|
||||
phi_div = 2 * alpha * (phi_div_middle) / (numpy.linalg.norm(diff)**3) * b
|
||||
|
||||
r_divs = (-p / (numpy.linalg.norm(diff)**3) + 3 * p.dot(diff) * diff / (numpy.linalg.norm(diff)**5)) * 2 * alpha * b
|
||||
|
||||
f2 = dot.f**2
|
||||
w2 = w**2
|
||||
|
||||
w_div = alpha**2 * (1 / numpy.pi) * ((f2 - w2) / ((f2 + w2)**2))
|
||||
|
||||
return numpy.concatenate((theta_div, phi_div, r_divs, w_div), axis=None)
|
||||
|
||||
|
||||
@dataclass
|
||||
class FixedMagnitudeDiscretisation():
|
||||
'''
|
||||
Representation of a discretisation of a FixedMagnitudeDiscretisation.
|
||||
Also captures a rough maximum value of dipole.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : FixedMagnitudeModel
|
||||
The parent model of the discretisation.
|
||||
num_ptheta: int
|
||||
The number of partitions of ptheta.
|
||||
num_pphi: int
|
||||
The number of partitions of pphi.
|
||||
num_x : int
|
||||
The number of partitions of the x axis.
|
||||
num_y : int
|
||||
The number of partitions of the y axis.
|
||||
num_z : int
|
||||
The number of partitions of the z axis.
|
||||
'''
|
||||
model: FixedMagnitudeModel
|
||||
num_ptheta: int
|
||||
num_pphi: int
|
||||
num_x: int
|
||||
num_y: int
|
||||
num_z: int
|
||||
|
||||
def __post_init__(self):
|
||||
self.cell_count = self.num_x * self.num_y * self.num_z
|
||||
self.x_step = (self.model.xmax - self.model.xmin) / self.num_x
|
||||
self.y_step = (self.model.ymax - self.model.ymin) / self.num_y
|
||||
self.z_step = (self.model.zmax - self.model.zmin) / self.num_z
|
||||
self.h_step = 2 / self.num_ptheta
|
||||
self.phi_step = 2 * numpy.pi / self.num_pphi
|
||||
|
||||
def bounds(self, index: Tuple[float, float, float, float, float]) -> Tuple:
|
||||
pthetai, pphii, xi, yi, zi = index
|
||||
|
||||
# For this model, a point is (p_theta, p_phi, sx, sx, sy, w).
|
||||
# We want to keep w unbounded, restrict sx, sy, sz, px and py based on step.
|
||||
return (
|
||||
[
|
||||
numpy.arccos(1 - pthetai * self.h_step), pphii * self.phi_step,
|
||||
xi * self.x_step + self.model.xmin, yi * self.y_step + self.model.ymin, zi * self.z_step + self.model.zmin,
|
||||
-numpy.inf
|
||||
],
|
||||
[
|
||||
numpy.arccos(1 - (pthetai + 1) * self.h_step), (pphii + 1) * self.phi_step,
|
||||
(xi + 1) * self.x_step + self.model.xmin, (yi + 1) * self.y_step + self.model.ymin, (zi + 1) * self.z_step + self.model.zmin,
|
||||
numpy.inf
|
||||
]
|
||||
frequency = rng.uniform(0, max_frequency)
|
||||
return OscillatingDipoleArrangement(
|
||||
[OscillatingDipole(numpy.array([px, py, pz]), s_pts, frequency)]
|
||||
)
|
||||
|
||||
def all_indices(self) -> numpy.ndindex:
|
||||
# see https://github.com/numpy/numpy/issues/20706 for why this is a mypy problem.
|
||||
return numpy.ndindex((self.num_ptheta, self.num_pphi, self.num_x, self.num_y, self.num_z)) # type:ignore
|
||||
def get_monte_carlo_dipole_inputs(
|
||||
self, n: int, max_frequency: float, rng_to_use: numpy.random.Generator = None
|
||||
) -> numpy.ndarray:
|
||||
|
||||
def solve_for_index(self, dots: Sequence[DotMeasurement], index: Tuple[float, float, float, float, float]) -> scipy.optimize.OptimizeResult:
|
||||
bounds = self.bounds(index)
|
||||
ptheta_mean = (bounds[0][0] + bounds[1][0]) / 2
|
||||
pphi_mean = (bounds[0][1] + bounds[1][1]) / 2
|
||||
sx_mean = (bounds[0][2] + bounds[1][2]) / 2
|
||||
sy_mean = (bounds[0][3] + bounds[1][3]) / 2
|
||||
sz_mean = (bounds[0][4] + bounds[1][4]) / 2
|
||||
return self.model.solve(dots, initial_pt=numpy.array([ptheta_mean, pphi_mean, sx_mean, sy_mean, sz_mean, .1]), bounds=bounds)
|
||||
rng: numpy.random.Generator
|
||||
if rng_to_use is None:
|
||||
rng = self.rng
|
||||
else:
|
||||
rng = rng_to_use
|
||||
|
||||
shape = (n, 1)
|
||||
theta = 2 * numpy.pi * rng.random(shape)
|
||||
phi = numpy.arccos(2 * rng.random(shape) - 1)
|
||||
px = self.pfixed * numpy.cos(theta) * numpy.sin(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(phi)
|
||||
|
||||
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 = rng.uniform(1, max_frequency, shape)
|
||||
|
||||
return numpy.stack([px, py, pz, sx, sy, sz, w], axis=-1)
|
||||
|
@ -1,131 +0,0 @@
|
||||
import numpy
|
||||
from dataclasses import dataclass
|
||||
from typing import Tuple, Sequence
|
||||
import scipy.optimize
|
||||
|
||||
from pdme.model.model import Model
|
||||
from pdme.measurement import DotMeasurement
|
||||
|
||||
|
||||
class FixedZPlaneModel(Model):
|
||||
'''
|
||||
Model of oscillating dipoles constrained to lie within a plane.
|
||||
Additionally, each dipole is assumed to be orientated in the plus or minus z direction.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
z : float
|
||||
The z position of the plane where dipoles are constrained to lie.
|
||||
xmin : float
|
||||
The minimum x value for dipoles.
|
||||
xmax : float
|
||||
The maximum x value for dipoles.
|
||||
ymin : float
|
||||
The minimum y value for dipoles.
|
||||
ymax : float
|
||||
The maximum y value for dipoles.
|
||||
n : int
|
||||
The number of dipoles to assume.
|
||||
'''
|
||||
def __init__(self, z: float, xmin: float, xmax: float, ymin: float, ymax: float, n: int) -> None:
|
||||
self.z = z
|
||||
self.xmin = xmin
|
||||
self.xmax = xmax
|
||||
self.ymin = ymin
|
||||
self.ymax = ymax
|
||||
self._n = n
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'FixedZPlaneModel({self.z}, {self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.n()})'
|
||||
|
||||
def point_length(self) -> int:
|
||||
'''
|
||||
Dipole is constrained in this model to have (px, py, pz) = (0, 0, pz) and (sx, sy, sz) = (sx, sy, self.z).
|
||||
With some frequency w, there are four degrees of freedom: (pz, sx, sy, w).
|
||||
'''
|
||||
return 4
|
||||
|
||||
def n(self) -> int:
|
||||
return self._n
|
||||
|
||||
def v_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> float:
|
||||
p = numpy.array([0, 0, pt[0]])
|
||||
s = numpy.array([pt[1], pt[2], self.z])
|
||||
w = pt[3]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
return alpha**2 * b
|
||||
|
||||
def jac_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> numpy.ndarray:
|
||||
p = numpy.array([0, 0, pt[0]])
|
||||
s = numpy.array([pt[1], pt[2], self.z])
|
||||
w = pt[3]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
|
||||
p_divs = 2 * alpha * diff[2] / (numpy.linalg.norm(diff)**3) * b # only need the z component.
|
||||
|
||||
r_divs = (-p[0:2] / (numpy.linalg.norm(diff)**3) + 3 * p.dot(diff) * diff[0:2] / (numpy.linalg.norm(diff)**5)) * 2 * alpha * b
|
||||
|
||||
f2 = dot.f**2
|
||||
w2 = w**2
|
||||
|
||||
w_div = alpha**2 * (1 / numpy.pi) * ((f2 - w2) / ((f2 + w2)**2))
|
||||
|
||||
return numpy.concatenate((p_divs, r_divs, w_div), axis=None)
|
||||
|
||||
|
||||
@dataclass
|
||||
class FixedZPlaneDiscretisation():
|
||||
'''
|
||||
Representation of a discretisation of a FixedZPlaneModel.
|
||||
Also captures a rough maximum value of dipole.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : FixedZPlaneModel
|
||||
The parent model of the discretisation.
|
||||
num_pz: int
|
||||
The number of partitions of pz.
|
||||
num_x : int
|
||||
The number of partitions of the x axis.
|
||||
num_y : int
|
||||
The number of partitions of the y axis.
|
||||
'''
|
||||
model: FixedZPlaneModel
|
||||
num_pz: int
|
||||
num_x: int
|
||||
num_y: int
|
||||
max_pz: int
|
||||
|
||||
def __post_init__(self):
|
||||
self.cell_count = self.num_x * self.num_y
|
||||
self.pz_step = (2 * self.max_pz) / self.num_pz
|
||||
self.x_step = (self.model.xmax - self.model.xmin) / self.num_x
|
||||
self.y_step = (self.model.ymax - self.model.ymin) / self.num_y
|
||||
|
||||
def bounds(self, index: Tuple[float, float, float]) -> Tuple[numpy.ndarray, numpy.ndarray]:
|
||||
pzi, xi, yi = index
|
||||
|
||||
# For this model, a point is (pz, sx, sy, w).
|
||||
# We want to keep w bounded, and restrict pz, sx and sy based on step.
|
||||
return (
|
||||
numpy.array((pzi * self.pz_step - self.max_pz, xi * self.x_step + self.model.xmin, yi * self.y_step + self.model.ymin, -numpy.inf)),
|
||||
numpy.array(((pzi + 1) * self.pz_step - self.max_pz, (xi + 1) * self.x_step + self.model.xmin, (yi + 1) * self.y_step + self.model.ymin, numpy.inf))
|
||||
)
|
||||
|
||||
def all_indices(self) -> numpy.ndindex:
|
||||
# see https://github.com/numpy/numpy/issues/20706 for why this is a mypy problem.
|
||||
return numpy.ndindex((self.num_pz, self.num_x, self.num_y)) # type:ignore
|
||||
|
||||
def solve_for_index(self, dots: Sequence[DotMeasurement], index: Tuple[float, float, float]) -> scipy.optimize.OptimizeResult:
|
||||
bounds = self.bounds(index)
|
||||
pz_mean = (bounds[0][0] + bounds[1][0]) / 2
|
||||
sx_mean = (bounds[0][1] + bounds[1][1]) / 2
|
||||
sy_mean = (bounds[0][2] + bounds[1][2]) / 2
|
||||
# I don't care about the typing here at the moment.
|
||||
return self.model.solve(dots, initial_pt=numpy.array((pz_mean, sx_mean, sy_mean, .1)), bounds=bounds) # type: ignore
|
195
pdme/model/log_spaced_random_choice_fixed_orientation_model.py
Normal file
195
pdme/model/log_spaced_random_choice_fixed_orientation_model.py
Normal file
@ -0,0 +1,195 @@
|
||||
import numpy
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
import logging
|
||||
from typing import Optional
|
||||
import pdme.subspace_simulation
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel(
|
||||
DipoleModel
|
||||
):
|
||||
"""
|
||||
Model of multiple oscillating dipoles with a fixed magnitude and fixed rotation. Spaced log uniformly in relaxation time.
|
||||
|
||||
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.
|
||||
|
||||
thetafixed: float
|
||||
The fixed theta (polar angle).
|
||||
Should be between 0 and pi.
|
||||
|
||||
phifixed: float
|
||||
The fixed phi (azimuthal angle).
|
||||
Should be between 0 and 2 pi.
|
||||
|
||||
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,
|
||||
thetafixed: float,
|
||||
phifixed: 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.thetafixed = thetafixed
|
||||
self.phifixed = phifixed
|
||||
self.rng = numpy.random.default_rng()
|
||||
self.n_max = n_max
|
||||
|
||||
px = self.pfixed * numpy.sin(self.thetafixed) * numpy.cos(self.phifixed)
|
||||
py = self.pfixed * numpy.sin(self.thetafixed) * numpy.sin(self.phifixed)
|
||||
pz = self.pfixed * numpy.cos(self.thetafixed)
|
||||
|
||||
self.moment_fixed = numpy.array([px, py, pz])
|
||||
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"LogSpacedRandomCountMultipleDipoleFixedMagnitudeFixedOrientationModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.wexp_min}, {self.wexp_max}, {self.pfixed}, {self.thetafixed}, {self.phifixed}, {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):
|
||||
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(self.moment_fixed, 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)
|
||||
|
||||
p_mask = rng.binomial(1, self.prob_occupancy, shape)
|
||||
|
||||
# dipoles = numpy.einsum("ij,k->ijk", p_mask, self.moment_fixed)
|
||||
# Is there a better way to create the final array? probably! can create a flatter guy then reshape.
|
||||
# this is easier to reason about.
|
||||
p_magnitude = self.pfixed * p_mask
|
||||
|
||||
px = p_magnitude * numpy.sin(self.thetafixed) * numpy.cos(self.phifixed)
|
||||
py = p_magnitude * numpy.sin(self.thetafixed) * numpy.sin(self.phifixed)
|
||||
pz = p_magnitude * numpy.cos(self.thetafixed)
|
||||
|
||||
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)
|
||||
|
||||
def markov_chain_monte_carlo_proposal(
|
||||
self,
|
||||
dipole: numpy.ndarray,
|
||||
stdev: pdme.subspace_simulation.DipoleStandardDeviation,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> numpy.ndarray:
|
||||
if rng_arg is None:
|
||||
rng_to_use = self.rng
|
||||
else:
|
||||
rng_to_use = rng_arg
|
||||
|
||||
px = dipole[0]
|
||||
py = dipole[1]
|
||||
pz = dipole[2]
|
||||
# won't change p for this model of fixed dipole moment.
|
||||
|
||||
rx = dipole[3]
|
||||
ry = dipole[4]
|
||||
rz = dipole[5]
|
||||
|
||||
tentative_rx = rx + stdev.rx_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rx < self.xmin or tentative_rx > self.xmax:
|
||||
tentative_rx = rx
|
||||
|
||||
tentative_ry = ry + stdev.ry_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_ry < self.ymin or tentative_ry > self.ymax:
|
||||
tentative_ry = ry
|
||||
tentative_rz = rz + stdev.rz_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rz < self.zmin or tentative_rz > self.zmax:
|
||||
tentative_rz = rz
|
||||
|
||||
w = dipole[6]
|
||||
tentative_w = numpy.exp(
|
||||
numpy.log(w) + (stdev.w_log_step * rng_to_use.uniform(-1, 1))
|
||||
)
|
||||
tentative_dip = numpy.array(
|
||||
[
|
||||
px,
|
||||
py,
|
||||
pz,
|
||||
tentative_rx,
|
||||
tentative_ry,
|
||||
tentative_rz,
|
||||
tentative_w,
|
||||
]
|
||||
)
|
||||
return tentative_dip
|
199
pdme/model/log_spaced_random_choice_model.py
Normal file
199
pdme/model/log_spaced_random_choice_model.py
Normal file
@ -0,0 +1,199 @@
|
||||
import numpy
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
import pdme.subspace_simulation
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel(DipoleModel):
|
||||
"""
|
||||
Model of multiple oscillating dipoles with a fixed magnitude, but free rotation. 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"LogSpacedRandomCountMultipleDipoleFixedMagnitudeModel({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):
|
||||
theta = numpy.arccos(rng.uniform(-1, 1))
|
||||
phi = rng.uniform(0, 2 * numpy.pi)
|
||||
px = self.pfixed * numpy.sin(theta) * numpy.cos(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(theta)
|
||||
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)
|
||||
theta = 2 * numpy.pi * rng.random(shape)
|
||||
phi = numpy.arccos(2 * rng.random(shape) - 1)
|
||||
|
||||
p_mask = rng.binomial(1, self.prob_occupancy, shape)
|
||||
p_magnitude = self.pfixed * p_mask
|
||||
|
||||
px = p_magnitude * numpy.cos(theta) * numpy.sin(phi)
|
||||
py = p_magnitude * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = p_magnitude * numpy.cos(phi)
|
||||
|
||||
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)
|
||||
|
||||
def markov_chain_monte_carlo_proposal(
|
||||
self,
|
||||
dipole: numpy.ndarray,
|
||||
stdev: pdme.subspace_simulation.DipoleStandardDeviation,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> numpy.ndarray:
|
||||
if rng_arg is None:
|
||||
rng_to_use = self.rng
|
||||
else:
|
||||
rng_to_use = rng_arg
|
||||
|
||||
px = dipole[0]
|
||||
py = dipole[1]
|
||||
pz = dipole[2]
|
||||
theta = numpy.arccos(pz / self.pfixed)
|
||||
phi = numpy.arctan2(py, px)
|
||||
|
||||
# need to step phi, theta, rx, ry, rz, w
|
||||
# then p^\ast is 1/(2 phi_step) and Delta = phi_step(2 * {0, 1} - 1)
|
||||
delta_phi = stdev.p_phi_step * rng_to_use.uniform(-1, 1)
|
||||
tentative_phi = phi + delta_phi
|
||||
|
||||
# theta
|
||||
delta_theta = stdev.p_theta_step * rng_to_use.uniform(-1, 1)
|
||||
r = (numpy.sin(theta + delta_theta)) / (numpy.sin(theta))
|
||||
if r > rng_to_use.uniform(0, 1):
|
||||
tentative_theta = theta + delta_theta
|
||||
else:
|
||||
tentative_theta = theta
|
||||
|
||||
tentative_px = (
|
||||
self.pfixed * numpy.sin(tentative_theta) * numpy.cos(tentative_phi)
|
||||
)
|
||||
tentative_py = (
|
||||
self.pfixed * numpy.sin(tentative_theta) * numpy.sin(tentative_phi)
|
||||
)
|
||||
tentative_pz = self.pfixed * numpy.cos(tentative_theta)
|
||||
|
||||
rx = dipole[3]
|
||||
ry = dipole[4]
|
||||
rz = dipole[5]
|
||||
|
||||
tentative_rx = rx + stdev.rx_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rx < self.xmin or tentative_rx > self.xmax:
|
||||
tentative_rx = rx
|
||||
|
||||
tentative_ry = ry + stdev.ry_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_ry < self.ymin or tentative_ry > self.ymax:
|
||||
tentative_ry = ry
|
||||
tentative_rz = rz + stdev.rz_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rz < self.zmin or tentative_rz > self.zmax:
|
||||
tentative_rz = rz
|
||||
|
||||
w = dipole[6]
|
||||
tentative_w = numpy.exp(
|
||||
numpy.log(w) + (stdev.w_log_step * rng_to_use.uniform(-1, 1))
|
||||
)
|
||||
tentative_dip = numpy.array(
|
||||
[
|
||||
tentative_px,
|
||||
tentative_py,
|
||||
tentative_pz,
|
||||
tentative_rx,
|
||||
tentative_ry,
|
||||
tentative_rz,
|
||||
tentative_w,
|
||||
]
|
||||
)
|
||||
return tentative_dip
|
183
pdme/model/log_spaced_random_choice_xy_model.py
Normal file
183
pdme/model/log_spaced_random_choice_xy_model.py
Normal file
@ -0,0 +1,183 @@
|
||||
import numpy
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
import pdme.subspace_simulation
|
||||
from typing import Optional
|
||||
|
||||
|
||||
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)
|
||||
|
||||
def markov_chain_monte_carlo_proposal(
|
||||
self,
|
||||
dipole: numpy.ndarray,
|
||||
stdev: pdme.subspace_simulation.DipoleStandardDeviation,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> numpy.ndarray:
|
||||
if rng_arg is None:
|
||||
rng_to_use = self.rng
|
||||
else:
|
||||
rng_to_use = rng_arg
|
||||
|
||||
px = dipole[0]
|
||||
py = dipole[1]
|
||||
pz = dipole[2]
|
||||
phi = numpy.arctan2(py, px)
|
||||
|
||||
# need to step phi, rx, ry, rz, w
|
||||
# then p^\ast is 1/(2 phi_step) and Delta = phi_step(2 * {0, 1} - 1)
|
||||
delta_phi = stdev.p_phi_step * rng_to_use.uniform(-1, 1)
|
||||
tentative_phi = phi + delta_phi
|
||||
|
||||
tentative_px = self.pfixed * numpy.cos(tentative_phi)
|
||||
tentative_py = self.pfixed * numpy.sin(tentative_phi)
|
||||
|
||||
rx = dipole[3]
|
||||
ry = dipole[4]
|
||||
rz = dipole[5]
|
||||
|
||||
tentative_rx = rx + stdev.rx_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rx < self.xmin or tentative_rx > self.xmax:
|
||||
tentative_rx = rx
|
||||
|
||||
tentative_ry = ry + stdev.ry_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_ry < self.ymin or tentative_ry > self.ymax:
|
||||
tentative_ry = ry
|
||||
tentative_rz = rz + stdev.rz_step * rng_to_use.uniform(-1, 1)
|
||||
if tentative_rz < self.zmin or tentative_rz > self.zmax:
|
||||
tentative_rz = rz
|
||||
|
||||
w = dipole[6]
|
||||
tentative_w = numpy.exp(
|
||||
numpy.log(w) + (stdev.w_log_step * rng_to_use.uniform(-1, 1))
|
||||
)
|
||||
tentative_dip = numpy.array(
|
||||
[
|
||||
tentative_px,
|
||||
tentative_py,
|
||||
pz,
|
||||
tentative_rx,
|
||||
tentative_ry,
|
||||
tentative_rz,
|
||||
tentative_w,
|
||||
]
|
||||
)
|
||||
return tentative_dip
|
@ -1,88 +1,163 @@
|
||||
import numpy
|
||||
import scipy.optimize
|
||||
from typing import Callable, Sequence
|
||||
from pdme.measurement import DotMeasurement
|
||||
import pdme.util
|
||||
import numpy.random
|
||||
from pdme.measurement import (
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
import logging
|
||||
import pdme.subspace_simulation
|
||||
from typing import List, Tuple, Optional
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Model():
|
||||
class DipoleModel:
|
||||
"""
|
||||
Interface for models.
|
||||
Interface for models based on dipoles.
|
||||
Some concepts are kept specific for dipole-based models, even though other types of models could be useful later on.
|
||||
"""
|
||||
|
||||
def point_length(self) -> int:
|
||||
def get_dipoles(
|
||||
self, max_frequency: float, rng: numpy.random.Generator = None
|
||||
) -> OscillatingDipoleArrangement:
|
||||
"""
|
||||
For a particular maximum frequency, gets a dipole arrangement based on the model that uniformly distributes its choices according to the model.
|
||||
If no rng is passed in, uses some default, but you might not want that.
|
||||
Frequencies should be chosen uniformly on range of (0, max_frequency).
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def n(self) -> int:
|
||||
def get_monte_carlo_dipole_inputs(
|
||||
self, n: int, max_frequency: float, rng: numpy.random.Generator = None
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
For a given DipoleModel, gets a set of dipole collections as a monte_carlo_n x dipole_count x 7 numpy array.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def v_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> float:
|
||||
def markov_chain_monte_carlo_proposal(
|
||||
self,
|
||||
dipole: numpy.ndarray,
|
||||
stdev: pdme.subspace_simulation.DipoleStandardDeviation,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> numpy.ndarray:
|
||||
raise NotImplementedError
|
||||
|
||||
def cost_for_dot(self, dot: DotMeasurement, pts: numpy.ndarray) -> float:
|
||||
# creates numpy.ndarrays in groups of self.point_length().
|
||||
# Will throw problems for irregular points, but that's okay for now.
|
||||
pt_length = self.point_length()
|
||||
chunked_pts = [pts[i: i + pt_length] for i in range(0, len(pts), pt_length)]
|
||||
return sum(self.v_for_point_at_dot(dot, pt) for pt in chunked_pts) - dot.v
|
||||
def get_mcmc_chain(
|
||||
self,
|
||||
seed,
|
||||
cost_function,
|
||||
chain_length,
|
||||
threshold_cost: float,
|
||||
stdevs: pdme.subspace_simulation.MCMCStandardDeviation,
|
||||
initial_cost: Optional[float] = None,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> List[Tuple[float, numpy.ndarray]]:
|
||||
"""
|
||||
performs constrained markov chain monte carlo starting on seed parameter.
|
||||
The cost function given is used as a constrained to condition the chain;
|
||||
a new state is only accepted if cost_function(state) < cost_function(previous_state).
|
||||
The stdevs passed in are the stdevs we're expected to use.
|
||||
|
||||
def costs(self, dots: Sequence[DotMeasurement]) -> Callable[[numpy.ndarray], numpy.ndarray]:
|
||||
'''
|
||||
Returns a function that returns the cost for the given list of DotMeasurements for a particular model-dependent phase space point.
|
||||
Default implementation assumes a single dot cost from which to build the list.
|
||||
Because we're using this for subspace simulation where our proposal function is not too important, we're in good shape.
|
||||
Note that for our adaptive stdevs to work, there's an unwritten contract that we sort each dipole in the state by frequency (increasing).
|
||||
|
||||
Parameters
|
||||
----------
|
||||
dots: A list of dot measurements to use to find the cost functions.
|
||||
The seed is a list of dipoles, and each chain state is a list of dipoles as well.
|
||||
|
||||
Returns
|
||||
----------
|
||||
Returns the model's cost function.
|
||||
'''
|
||||
logging.debug(f"Constructing costs for dots: {dots}")
|
||||
initial_cost is a performance guy that lets you pre-populate the initial cost used to define the condition.
|
||||
Probably premature optimisation.
|
||||
|
||||
def costs_to_return(pts: numpy.ndarray) -> numpy.ndarray:
|
||||
return numpy.array([self.cost_for_dot(dot, pts) for dot in dots])
|
||||
|
||||
return costs_to_return
|
||||
|
||||
def jac_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> numpy.ndarray:
|
||||
raise NotImplementedError
|
||||
|
||||
def jac_for_dot(self, dot: DotMeasurement, pts: numpy.ndarray) -> numpy.ndarray:
|
||||
# creates numpy.ndarrays in groups of self.point_length().
|
||||
# Will throw problems for irregular points, but that's okay for now.
|
||||
pt_length = self.point_length()
|
||||
chunked_pts = [pts[i: i + pt_length] for i in range(0, len(pts), pt_length)]
|
||||
return numpy.append([], [self.jac_for_point_at_dot(dot, pt) for pt in chunked_pts])
|
||||
|
||||
def jac(self, dots: Sequence[DotMeasurement]) -> Callable[[numpy.ndarray], numpy.ndarray]:
|
||||
'''
|
||||
Returns a function that returns the cost function's Jacobian for the given list of DotMeasurements for a particular model-dependent phase space point.
|
||||
Default implementation assumes a single dot jacobian from which to build the list.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
dots: A list of dot measurements to use to find the cost functions and their Jacobian.
|
||||
|
||||
Returns
|
||||
----------
|
||||
Returns the model's cost function's Jacobian.
|
||||
'''
|
||||
def jac_to_return(pts: numpy.ndarray) -> numpy.ndarray:
|
||||
return numpy.array([self.jac_for_dot(dot, pts) for dot in dots])
|
||||
|
||||
return jac_to_return
|
||||
|
||||
def solve(self, dots: Sequence[DotMeasurement], initial_pt: numpy.ndarray = None, bounds=(-numpy.inf, numpy.inf)) -> scipy.optimize.OptimizeResult:
|
||||
if initial_pt is None:
|
||||
initial = numpy.tile(.1, self.n() * self.point_length())
|
||||
Returns a chain of [ (cost: float, state: dipole_ndarray ) ] format.
|
||||
"""
|
||||
_logger.debug(
|
||||
f"Starting Markov Chain Monte Carlo with seed: {seed} for chain length {chain_length} and provided stdevs {stdevs}"
|
||||
)
|
||||
chain: List[Tuple[float, numpy.ndarray]] = []
|
||||
if initial_cost is None:
|
||||
current_cost = cost_function(numpy.array([seed]))
|
||||
else:
|
||||
if len(initial_pt) != self.point_length():
|
||||
raise ValueError(f"The initial point {initial_pt} does not have the model's expected length: {self.point_length()}")
|
||||
initial = numpy.tile(initial_pt, self.n())
|
||||
current_cost = initial_cost
|
||||
current = seed
|
||||
for i in range(chain_length):
|
||||
dips = []
|
||||
for dipole_index, dipole in enumerate(current):
|
||||
_logger.debug(dipole_index)
|
||||
_logger.debug(dipole)
|
||||
stdev = stdevs[dipole_index]
|
||||
tentative_dip = self.markov_chain_monte_carlo_proposal(
|
||||
dipole, stdev, rng_arg
|
||||
)
|
||||
|
||||
result = scipy.optimize.least_squares(self.costs(dots), initial, jac=self.jac(dots), ftol=1e-15, gtol=3e-16, xtol=None, bounds=bounds)
|
||||
result.normalised_x = pdme.util.normalise_point_list(result.x, self.point_length())
|
||||
return result
|
||||
dips.append(tentative_dip)
|
||||
dips_array = pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
||||
dips
|
||||
)
|
||||
tentative_cost = cost_function(numpy.array([dips_array]))[0]
|
||||
if tentative_cost < threshold_cost:
|
||||
chain.append((numpy.squeeze(tentative_cost).item(), dips_array))
|
||||
current = dips_array
|
||||
current_cost = tentative_cost
|
||||
else:
|
||||
chain.append((numpy.squeeze(current_cost).item(), current))
|
||||
return chain
|
||||
|
||||
def get_repeat_counting_mcmc_chain(
|
||||
self,
|
||||
seed,
|
||||
cost_function,
|
||||
chain_length,
|
||||
threshold_cost: float,
|
||||
stdevs: pdme.subspace_simulation.MCMCStandardDeviation,
|
||||
initial_cost: Optional[float] = None,
|
||||
rng_arg: Optional[numpy.random.Generator] = None,
|
||||
) -> Tuple[int, List[Tuple[float, numpy.ndarray]]]:
|
||||
"""
|
||||
performs constrained markov chain monte carlo starting on seed parameter.
|
||||
The cost function given is used as a constrained to condition the chain;
|
||||
a new state is only accepted if cost_function(state) < cost_function(previous_state).
|
||||
The stdevs passed in are the stdevs we're expected to use.
|
||||
|
||||
Because we're using this for subspace simulation where our proposal function is not too important, we're in good shape.
|
||||
Note that for our adaptive stdevs to work, there's an unwritten contract that we sort each dipole in the state by frequency (increasing).
|
||||
|
||||
The seed is a list of dipoles, and each chain state is a list of dipoles as well.
|
||||
|
||||
initial_cost is a performance guy that lets you pre-populate the initial cost used to define the condition.
|
||||
Probably premature optimisation.
|
||||
|
||||
Chain has type of [ (cost: float, state: dipole_ndarray ) ] format,
|
||||
returning (repeat_count, chain) to keep track of number of repeats
|
||||
"""
|
||||
_logger.debug(
|
||||
f"Starting Markov Chain Monte Carlo with seed: {seed} for chain length {chain_length} and provided stdevs {stdevs}"
|
||||
)
|
||||
chain: List[Tuple[float, numpy.ndarray]] = []
|
||||
if initial_cost is None:
|
||||
current_cost = cost_function(numpy.array([seed]))
|
||||
else:
|
||||
current_cost = initial_cost
|
||||
current = seed
|
||||
repeat_event_count = 0
|
||||
for _ in range(chain_length):
|
||||
dips = []
|
||||
for dipole_index, dipole in enumerate(current):
|
||||
_logger.debug(dipole_index)
|
||||
_logger.debug(dipole)
|
||||
stdev = stdevs[dipole_index]
|
||||
tentative_dip = self.markov_chain_monte_carlo_proposal(
|
||||
dipole, stdev, rng_arg
|
||||
)
|
||||
|
||||
dips.append(tentative_dip)
|
||||
dips_array = pdme.subspace_simulation.sort_array_of_dipoles_by_frequency(
|
||||
dips
|
||||
)
|
||||
tentative_cost = cost_function(numpy.array([dips_array]))[0]
|
||||
if tentative_cost < threshold_cost:
|
||||
chain.append((numpy.squeeze(tentative_cost).item(), dips_array))
|
||||
current = dips_array
|
||||
current_cost = tentative_cost
|
||||
else:
|
||||
# repeating a sample, increase count
|
||||
repeat_event_count += 1
|
||||
chain.append((numpy.squeeze(current_cost).item(), current))
|
||||
return (repeat_event_count, chain)
|
||||
|
104
pdme/model/multidipole_fixed_magnitude_model.py
Normal file
104
pdme/model/multidipole_fixed_magnitude_model.py
Normal file
@ -0,0 +1,104 @@
|
||||
import numpy
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
|
||||
|
||||
class MultipleDipoleFixedMagnitudeModel(DipoleModel):
|
||||
"""
|
||||
Model of multiple oscillating dipoles with a fixed magnitude, but free rotation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
pfixed : float
|
||||
The fixed dipole magnitude.
|
||||
|
||||
n : int
|
||||
The number of dipoles.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
xmin: float,
|
||||
xmax: float,
|
||||
ymin: float,
|
||||
ymax: float,
|
||||
zmin: float,
|
||||
zmax: float,
|
||||
pfixed: float,
|
||||
n: int,
|
||||
) -> None:
|
||||
self.xmin = xmin
|
||||
self.xmax = xmax
|
||||
self.ymin = ymin
|
||||
self.ymax = ymax
|
||||
self.zmin = zmin
|
||||
self.zmax = zmax
|
||||
self.pfixed = pfixed
|
||||
self.rng = numpy.random.default_rng()
|
||||
self.n = n
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"MultipleDipoleFixedMagnitudeModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.pfixed}, {self.n})"
|
||||
|
||||
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 = []
|
||||
|
||||
for i in range(self.n):
|
||||
theta = numpy.arccos(rng.uniform(-1, 1))
|
||||
phi = rng.uniform(0, 2 * numpy.pi)
|
||||
px = self.pfixed * numpy.sin(theta) * numpy.cos(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(theta)
|
||||
s_pts = numpy.array(
|
||||
(
|
||||
rng.uniform(self.xmin, self.xmax),
|
||||
rng.uniform(self.ymin, self.ymax),
|
||||
rng.uniform(self.zmin, self.zmax),
|
||||
)
|
||||
)
|
||||
frequency = rng.uniform(0, max_frequency)
|
||||
|
||||
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,
|
||||
max_frequency: 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)
|
||||
theta = 2 * numpy.pi * rng.random(shape)
|
||||
phi = numpy.arccos(2 * rng.random(shape) - 1)
|
||||
px = self.pfixed * numpy.cos(theta) * numpy.sin(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(phi)
|
||||
|
||||
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 = rng.uniform(1, max_frequency, shape)
|
||||
|
||||
return numpy.stack([px, py, pz, sx, sy, sz, w], axis=-1)
|
119
pdme/model/random_count_multidipole_fixed_magnitude_model.py
Normal file
119
pdme/model/random_count_multidipole_fixed_magnitude_model.py
Normal file
@ -0,0 +1,119 @@
|
||||
import numpy
|
||||
import numpy.random
|
||||
from pdme.model.model import DipoleModel
|
||||
from pdme.measurement import (
|
||||
OscillatingDipole,
|
||||
OscillatingDipoleArrangement,
|
||||
)
|
||||
|
||||
|
||||
class RandomCountMultipleDipoleFixedMagnitudeModel(DipoleModel):
|
||||
"""
|
||||
Model of multiple oscillating dipoles with a fixed magnitude, but free rotation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
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,
|
||||
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.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"RandomCountMultipleDipoleFixedMagnitudeModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {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):
|
||||
theta = numpy.arccos(rng.uniform(-1, 1))
|
||||
phi = rng.uniform(0, 2 * numpy.pi)
|
||||
px = self.pfixed * numpy.sin(theta) * numpy.cos(phi)
|
||||
py = self.pfixed * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = self.pfixed * numpy.cos(theta)
|
||||
s_pts = numpy.array(
|
||||
(
|
||||
rng.uniform(self.xmin, self.xmax),
|
||||
rng.uniform(self.ymin, self.ymax),
|
||||
rng.uniform(self.zmin, self.zmax),
|
||||
)
|
||||
)
|
||||
frequency = rng.uniform(0, max_frequency)
|
||||
|
||||
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,
|
||||
max_frequency: 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)
|
||||
theta = 2 * numpy.pi * rng.random(shape)
|
||||
phi = numpy.arccos(2 * rng.random(shape) - 1)
|
||||
|
||||
p_mask = rng.binomial(1, self.prob_occupancy, shape)
|
||||
p_magnitude = self.pfixed * p_mask
|
||||
|
||||
px = p_magnitude * numpy.cos(theta) * numpy.sin(phi)
|
||||
py = p_magnitude * numpy.sin(theta) * numpy.sin(phi)
|
||||
pz = p_magnitude * numpy.cos(phi)
|
||||
|
||||
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 = rng.uniform(1, max_frequency, shape)
|
||||
|
||||
return numpy.stack([px, py, pz, sx, sy, sz, w], axis=-1)
|
@ -1,145 +0,0 @@
|
||||
import numpy
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence, Tuple
|
||||
import scipy.optimize
|
||||
from pdme.model.model import Model
|
||||
from pdme.measurement import DotMeasurement
|
||||
|
||||
|
||||
class UnrestrictedModel(Model):
|
||||
'''
|
||||
Model of oscillating dipoles with no restrictions.
|
||||
Additionally, each dipole is assumed to be orientated in the plus or minus z direction.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
n : int
|
||||
The number of dipoles to assume.
|
||||
'''
|
||||
def __init__(self, xmin: float, xmax: float, ymin: float, ymax: float, zmin: float, zmax: float, n: int) -> None:
|
||||
self.xmin = xmin
|
||||
self.xmax = xmax
|
||||
self.ymin = ymin
|
||||
self.ymax = ymax
|
||||
self.zmin = zmin
|
||||
self.zmax = zmax
|
||||
self._n = n
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f'UnrestrictedModel({self.xmin}, {self.xmax}, {self.ymin}, {self.ymax}, {self.zmin}, {self.zmax}, {self.n()})'
|
||||
|
||||
def point_length(self) -> int:
|
||||
'''
|
||||
Dipole is unconstrained in this model.
|
||||
All seven degrees of freedom: (px, py, pz, sx, sy, sz, w).
|
||||
'''
|
||||
return 7
|
||||
|
||||
def n(self) -> int:
|
||||
return self._n
|
||||
|
||||
def v_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> float:
|
||||
p = pt[0:3]
|
||||
s = pt[3:6]
|
||||
w = pt[6]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
return alpha**2 * b
|
||||
|
||||
def jac_for_point_at_dot(self, dot: DotMeasurement, pt: numpy.ndarray) -> numpy.ndarray:
|
||||
p = pt[0:3]
|
||||
s = pt[3:6]
|
||||
w = pt[6]
|
||||
|
||||
diff = dot.r - s
|
||||
alpha = p.dot(diff) / (numpy.linalg.norm(diff)**3)
|
||||
b = (1 / numpy.pi) * (w / (w**2 + dot.f**2))
|
||||
|
||||
p_divs = 2 * alpha * diff / (numpy.linalg.norm(diff)**3) * b
|
||||
|
||||
r_divs = (-p / (numpy.linalg.norm(diff)**3) + 3 * p.dot(diff) * diff / (numpy.linalg.norm(diff)**5)) * 2 * alpha * b
|
||||
|
||||
f2 = dot.f**2
|
||||
w2 = w**2
|
||||
|
||||
w_div = alpha**2 * (1 / numpy.pi) * ((f2 - w2) / ((f2 + w2)**2))
|
||||
|
||||
return numpy.concatenate((p_divs, r_divs, w_div), axis=None)
|
||||
|
||||
|
||||
@dataclass
|
||||
class UnrestrictedDiscretisation():
|
||||
'''
|
||||
Representation of a discretisation of a UnrestrictedModel.
|
||||
Also captures a rough maximum value of dipole.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
model : UnrestrictedModel
|
||||
The parent model of the discretisation.
|
||||
num_px: int
|
||||
The number of partitions of the px.
|
||||
num_py: int
|
||||
The number of partitions of the py.
|
||||
num_pz: int
|
||||
The number of partitions of pz.
|
||||
num_x : int
|
||||
The number of partitions of the x axis.
|
||||
num_y : int
|
||||
The number of partitions of the y axis.
|
||||
num_z : int
|
||||
The number of partitions of the z axis.
|
||||
max_p : int
|
||||
The maximum p coordinate in any direction.
|
||||
'''
|
||||
model: UnrestrictedModel
|
||||
num_px: int
|
||||
num_py: int
|
||||
num_pz: int
|
||||
num_x: int
|
||||
num_y: int
|
||||
num_z: int
|
||||
max_p: int
|
||||
|
||||
def __post_init__(self):
|
||||
self.cell_count = self.num_x * self.num_y * self.num_z
|
||||
self.x_step = (self.model.xmax - self.model.xmin) / self.num_x
|
||||
self.y_step = (self.model.ymax - self.model.ymin) / self.num_y
|
||||
self.z_step = (self.model.zmax - self.model.zmin) / self.num_z
|
||||
self.px_step = 2 * self.max_p / self.num_px
|
||||
self.py_step = 2 * self.max_p / self.num_py
|
||||
self.pz_step = 2 * self.max_p / self.num_pz
|
||||
|
||||
def bounds(self, index: Tuple[float, float, float, float, float, float]) -> Tuple:
|
||||
pxi, pyi, pzi, xi, yi, zi = index
|
||||
|
||||
# For this model, a point is (px, py, pz, sx, sx, sy, w).
|
||||
# We want to keep w unbounded, restrict sx, sy, sz, px and py based on step.
|
||||
return (
|
||||
[
|
||||
pxi * self.px_step - self.max_p, pyi * self.py_step - self.max_p, pzi * self.pz_step - self.max_p,
|
||||
xi * self.x_step + self.model.xmin, yi * self.y_step + self.model.ymin, zi * self.z_step + self.model.zmin,
|
||||
-numpy.inf
|
||||
],
|
||||
[
|
||||
(pxi + 1) * self.px_step - self.max_p, (pyi + 1) * self.py_step - self.max_p, (pzi + 1) * self.pz_step - self.max_p,
|
||||
(xi + 1) * self.x_step + self.model.xmin, (yi + 1) * self.y_step + self.model.ymin, (zi + 1) * self.z_step + self.model.zmin,
|
||||
numpy.inf
|
||||
]
|
||||
)
|
||||
|
||||
def all_indices(self) -> numpy.ndindex:
|
||||
# see https://github.com/numpy/numpy/issues/20706 for why this is a mypy problem.
|
||||
return numpy.ndindex((self.num_px, self.num_py, self.num_pz, self.num_x, self.num_y, self.num_z)) # type:ignore
|
||||
|
||||
def solve_for_index(self, dots: Sequence[DotMeasurement], index: Tuple[float, float, float, float, float, float]) -> scipy.optimize.OptimizeResult:
|
||||
bounds = self.bounds(index)
|
||||
px_mean = (bounds[0][0] + bounds[1][0]) / 2
|
||||
py_mean = (bounds[0][1] + bounds[1][1]) / 2
|
||||
pz_mean = (bounds[0][2] + bounds[1][2]) / 2
|
||||
sx_mean = (bounds[0][3] + bounds[1][3]) / 2
|
||||
sy_mean = (bounds[0][4] + bounds[1][4]) / 2
|
||||
sz_mean = (bounds[0][5] + bounds[1][5]) / 2
|
||||
return self.model.solve(dots, initial_pt=numpy.array([px_mean, py_mean, pz_mean, sx_mean, sy_mean, sz_mean, .1]), bounds=bounds)
|
0
pdme/py.typed
Normal file
0
pdme/py.typed
Normal file
74
pdme/subspace_simulation/__init__.py
Normal file
74
pdme/subspace_simulation/__init__.py
Normal file
@ -0,0 +1,74 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Sequence
|
||||
import numpy
|
||||
from pdme.subspace_simulation.mcmc_costs import (
|
||||
proportional_cost,
|
||||
proportional_costs_vs_actual_measurement,
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class DipoleStandardDeviation:
|
||||
"""
|
||||
contains the dipole standard deviation to be used in porposals for markov chain monte carlo
|
||||
"""
|
||||
|
||||
p_phi_step: float
|
||||
p_theta_step: float
|
||||
rx_step: float
|
||||
ry_step: float
|
||||
rz_step: float
|
||||
w_log_step: float
|
||||
|
||||
|
||||
class MCMCStandardDeviation:
|
||||
"""
|
||||
wrapper for multiple standard deviations, allows for flexible length stuff
|
||||
"""
|
||||
|
||||
def __init__(self, stdevs: Sequence[DipoleStandardDeviation]):
|
||||
self.stdevs = stdevs
|
||||
if len(stdevs) < 1:
|
||||
raise ValueError(f"Got stdevs: {stdevs}, must have length > 1")
|
||||
|
||||
def __getitem__(self, key):
|
||||
newkey = key % len(self.stdevs)
|
||||
return self.stdevs[newkey]
|
||||
|
||||
|
||||
def sort_array_of_dipoles_by_frequency(configuration) -> numpy.ndarray:
|
||||
"""
|
||||
Say we have a situation of 2 dipoles, and we've created 8 samples. Then we'll have an (8, 2, 7) numpy array.
|
||||
For each of the 8 samples, we want the 2 dipoles to be in order of frequency.
|
||||
|
||||
This just sorts each sample, the 2x7 array.
|
||||
|
||||
Utility function.
|
||||
"""
|
||||
return numpy.array(sorted(configuration, key=lambda l: l[6]))
|
||||
|
||||
|
||||
def sort_array_of_dipoleses_by_frequency(configurations) -> numpy.ndarray:
|
||||
"""
|
||||
Say we have a situation of 2 dipoles, and we've created 8 samples. Then we'll have an (8, 2, 7) numpy array.
|
||||
For each of the 8 samples, we want the 2 dipoles to be in order of frequency.
|
||||
|
||||
This is the wrapper that sorts everything.
|
||||
|
||||
Utility function.
|
||||
"""
|
||||
return numpy.array(
|
||||
[
|
||||
sort_array_of_dipoles_by_frequency(configuration)
|
||||
for configuration in configurations
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"DipoleStandardDeviation",
|
||||
"MCMCStandardDeviation",
|
||||
"sort_array_of_dipoles_by_frequency",
|
||||
"proportional_cost",
|
||||
"proportional_costs_vs_actual_measurement",
|
||||
]
|
30
pdme/subspace_simulation/mcmc_costs.py
Normal file
30
pdme/subspace_simulation/mcmc_costs.py
Normal file
@ -0,0 +1,30 @@
|
||||
import numpy
|
||||
import numpy.typing
|
||||
import pdme.util.fast_v_calc
|
||||
|
||||
|
||||
def proportional_cost(a: numpy.ndarray, b: numpy.ndarray) -> numpy.ndarray:
|
||||
tops = numpy.max(b / a, axis=-1)
|
||||
bottoms = numpy.max(a / b, axis=-1)
|
||||
return numpy.maximum(tops, bottoms)
|
||||
|
||||
|
||||
def proportional_costs_vs_actual_measurement(
|
||||
dot_inputs_array: numpy.ndarray,
|
||||
actual_measurement_array: numpy.ndarray,
|
||||
dipoles_to_test: numpy.ndarray,
|
||||
) -> numpy.ndarray:
|
||||
vals = pdme.util.fast_v_calc.fast_vs_for_dipoleses(
|
||||
dot_inputs_array, dipoles_to_test
|
||||
)
|
||||
return proportional_cost(actual_measurement_array, vals)
|
||||
|
||||
|
||||
def relative_square_diffs(
|
||||
approx: numpy.ndarray, target: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
# Assume that both approx and target are arrays of length m
|
||||
# Approx can broadcast if additional indexes to the left
|
||||
# diffs.shape = [ m ]
|
||||
diffs = (approx - target) ** 2 / (target**2)
|
||||
return diffs.sum(axis=-1)
|
@ -1,3 +0,0 @@
|
||||
from pdme.util.normal_form import normalise_point_list
|
||||
|
||||
__all__ = ["normalise_point_list"]
|
273
pdme/util/fast_nonlocal_spectrum.py
Normal file
273
pdme/util/fast_nonlocal_spectrum.py
Normal file
@ -0,0 +1,273 @@
|
||||
import numpy
|
||||
import logging
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def fast_s_nonlocal(
|
||||
dot_pair_inputs: numpy.ndarray, dipoles: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
"""
|
||||
ps = dipoles[:, 0:3]
|
||||
ss = dipoles[:, 3:6]
|
||||
ws = dipoles[:, 6]
|
||||
|
||||
_logger.debug(f"ps: {ps}")
|
||||
_logger.debug(f"ss: {ss}")
|
||||
_logger.debug(f"ws: {ws}")
|
||||
|
||||
r1s = dot_pair_inputs[:, 0, 0:3]
|
||||
r2s = dot_pair_inputs[:, 1, 0:3]
|
||||
f1s = dot_pair_inputs[:, 0, 3]
|
||||
f2s = dot_pair_inputs[:, 1, 3]
|
||||
|
||||
if (f1s != f2s).all():
|
||||
raise ValueError(f"Dot pair frequencies are inconsistent: {dot_pair_inputs}")
|
||||
|
||||
diffses1 = r1s - ss[:, None]
|
||||
diffses2 = r2s - ss[:, None]
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"diffses1: {diffses1}")
|
||||
_logger.debug(f"diffses2: {diffses2}")
|
||||
|
||||
norms1 = numpy.linalg.norm(diffses1, axis=2) ** 3
|
||||
norms2 = numpy.linalg.norm(diffses2, axis=2) ** 3
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"norms1: {norms1}")
|
||||
_logger.debug(f"norms2: {norms2}")
|
||||
|
||||
alphses1 = numpy.einsum("...ji, ...i", diffses1, ps) / norms1
|
||||
alphses2 = numpy.einsum("...ji, ...i", diffses2, ps) / norms2
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"alphses1: {alphses1}")
|
||||
_logger.debug(f"alphses2: {alphses2}")
|
||||
|
||||
bses = 2 * ws[:, None] / ((numpy.pi * f1s) ** 2 + ws[:, None] ** 2)
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"bses: {bses}")
|
||||
|
||||
return alphses1 * alphses2 * bses
|
||||
|
||||
|
||||
def fast_s_nonlocal_dipoleses(
|
||||
dot_pair_inputs: numpy.ndarray, dipoleses: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
"""
|
||||
|
||||
# We're going to annotate the indices on this class.
|
||||
# Let's define some indices:
|
||||
# A -> index of dipoleses configurations
|
||||
# measurement_index -> if we have 100 frequencies for example, indexes which one of them it is
|
||||
# j -> within a particular configuration, indexes dipole j
|
||||
# If we need to use numbers, let's use A -> 2, j -> 10, measurement_index -> 9 for consistency with
|
||||
# my other notes
|
||||
# cart -> {x, y, z} is a cartesian axis
|
||||
|
||||
# ps, ss have shape [A, j, cart]
|
||||
ps = dipoleses[:, :, 0:3]
|
||||
ss = dipoleses[:, :, 3:6]
|
||||
# ws shape [A, j]
|
||||
ws = dipoleses[:, :, 6]
|
||||
|
||||
_logger.debug(f"ps: {ps}")
|
||||
_logger.debug(f"ss: {ss}")
|
||||
_logger.debug(f"ws: {ws}")
|
||||
|
||||
# rs have shape [meas_idx, {}, cart], where the inner index goes away leaving
|
||||
# [meas, cart]
|
||||
r1s = dot_pair_inputs[:, 0, 0:3]
|
||||
r2s = dot_pair_inputs[:, 1, 0:3]
|
||||
# fs have index [meas_idx], this makes sense
|
||||
f1s = dot_pair_inputs[:, 0, 3]
|
||||
f2s = dot_pair_inputs[:, 1, 3]
|
||||
|
||||
if (f1s != f2s).all():
|
||||
raise ValueError(f"Dot pair frequencies are inconsistent: {dot_pair_inputs}")
|
||||
|
||||
# r1s have shape [meas, cart], adding the none makes it
|
||||
# r1s[:, None].shape = [meas, 1, cart]
|
||||
# ss[:, None, :].shape = [A, 1, j, cart]
|
||||
# subtracting broadcasts by matching from the right to the left, giving a final shape of
|
||||
# diffses.shape [A, meas, j, cart]
|
||||
diffses1 = r1s[:, None] - ss[:, None, :]
|
||||
diffses2 = r2s[:, None] - ss[:, None, :]
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"diffses1: {diffses1}")
|
||||
_logger.debug(f"diffses2: {diffses2}")
|
||||
|
||||
# norming on the cartesian axis, which is axis 3 as seen above
|
||||
# norms.shape [A, meas, j]
|
||||
norms1 = numpy.linalg.norm(diffses1, axis=3) ** 3
|
||||
norms2 = numpy.linalg.norm(diffses2, axis=3) ** 3
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"norms1: {norms1}")
|
||||
_logger.debug(f"norms2: {norms2}")
|
||||
|
||||
# diffses shape [A, meas, j, cart]
|
||||
# ps shape [A, j, cart]
|
||||
# so we're summing over the d axis, the cartesian one.
|
||||
# final shape of numerator is [A, meas, j]
|
||||
# denom shape is [A, meas, j]
|
||||
# final shape stayes [A, meas, j]
|
||||
alphses1 = numpy.einsum("abcd,acd->abc", diffses1, ps) / norms1
|
||||
alphses2 = numpy.einsum("abcd,acd->abc", diffses2, ps) / norms2
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"alphses1: {alphses1}")
|
||||
_logger.debug(f"alphses2: {alphses2}")
|
||||
|
||||
# ws shape [A, j], so numerator has shape [A, 1, j]
|
||||
# f1s shape is [meas], so first term of denom is [meas, 1]
|
||||
# ws[:, None, :].shape [A, 1, j] so breadcasting the sum in denom gives
|
||||
# denom.shape [A meas, j]
|
||||
# so now overall shape is [A, meas, j]
|
||||
bses = 2 * ws[:, None, :] / ((numpy.pi * f1s[:, None]) ** 2 + ws[:, None, :] ** 2)
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"bses: {bses}")
|
||||
|
||||
# so our output shape is [A, meas, j]
|
||||
_logger.debug(f"Raw pair calc: [{alphses1 * alphses2 * bses}]")
|
||||
return numpy.einsum("...j->...", alphses1 * alphses2 * bses)
|
||||
|
||||
|
||||
def fast_s_spin_qubit_tarucha_nonlocal_dipoleses(
|
||||
dot_pair_inputs: numpy.ndarray, dipoleses: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
"""
|
||||
|
||||
# We're going to annotate the indices on this class.
|
||||
# Let's define some indices:
|
||||
# A -> index of dipoleses configurations
|
||||
# j -> within a particular configuration, indexes dipole j
|
||||
# measurement_index -> if we have 100 frequencies for example, indexes which one of them it is
|
||||
# If we need to use numbers, let's use A -> 2, j -> 10, measurement_index -> 9 for consistency with
|
||||
# my other notes
|
||||
|
||||
# axes are [dipole_config_idx A, dipole_idx j, {px, py, pz}3]
|
||||
ps = dipoleses[:, :, 0:3]
|
||||
# axes are [dipole_config_idx A, dipole_idx j, {sx, sy, sz}3]
|
||||
ss = dipoleses[:, :, 3:6]
|
||||
# axes are [dipole_config_idx A, dipole_idx j, w], last axis is just 1
|
||||
ws = dipoleses[:, :, 6]
|
||||
|
||||
_logger.debug(f"ps: {ps}")
|
||||
_logger.debug(f"ss: {ss}")
|
||||
_logger.debug(f"ws: {ws}")
|
||||
|
||||
# dot_index is either 0 or 1 for dot1 or dot2
|
||||
# hopefully this adhoc grammar is making sense, with the explicit labelling of the values of the last axis in cartesian space
|
||||
# axes are [measurement_idx, {dot_index}, {rx, ry, rz}] where the inner {dot_index} is gone
|
||||
# [measurement_idx, cartesian3]
|
||||
r1s = dot_pair_inputs[:, 0, 0:3]
|
||||
r2s = dot_pair_inputs[:, 1, 0:3]
|
||||
# axes are [measurement_idx]
|
||||
f1s = dot_pair_inputs[:, 0, 3]
|
||||
f2s = dot_pair_inputs[:, 1, 3]
|
||||
|
||||
if (f1s != f2s).all():
|
||||
raise ValueError(f"Dot pair frequencies are inconsistent: {dot_pair_inputs}")
|
||||
|
||||
# first operation!
|
||||
# r1s has shape [measurement_idx, rxs]
|
||||
# None inserts an extra axis so the r1s[:, None] has shape
|
||||
# [measurement_idx, 1]([rxs]) with the last rxs hidden
|
||||
#
|
||||
# ss has shape [ A, j, {sx, sy, sz}3], so second term has shape [A, 1, j]([sxs])
|
||||
# these broadcast from right to left
|
||||
# [ measurement_idx, 1, rxs]
|
||||
# [A, 1, j, sxs]
|
||||
# resulting in [A, measurement_idx, j, cart3] sxs rxs are both cart3
|
||||
diffses1 = r1s[:, None] - ss[:, None, :]
|
||||
diffses2 = r2s[:, None] - ss[:, None, :]
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"diffses1: {diffses1}")
|
||||
_logger.debug(f"diffses2: {diffses2}")
|
||||
|
||||
# norms takes out axis 3, the last one, giving [A, measurement_idx, j]
|
||||
norms1 = numpy.linalg.norm(diffses1, axis=3)
|
||||
norms2 = numpy.linalg.norm(diffses2, axis=3)
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"norms1: {norms1}")
|
||||
_logger.debug(f"norms2: {norms2}")
|
||||
|
||||
# _logger.info(f"norms1: {norms1}")
|
||||
# _logger.info(f"norms1 shape: {norms1.shape}")
|
||||
#
|
||||
# diffses1 (A, measurement_idx, j, xs)
|
||||
# ps: (A, j, px)
|
||||
# result is (A, measurement_idx, j)
|
||||
# intermediate_dot_prod = numpy.einsum("abcd,acd->abc", diffses1, ps)
|
||||
# _logger.info(f"dot product shape: {intermediate_dot_prod.shape}")
|
||||
|
||||
# transpose makes it (j, measurement_idx, A)
|
||||
# transp_intermediate_dot_prod = numpy.transpose(numpy.einsum("abcd,acd->abc", diffses1, ps) / (norms1**3))
|
||||
|
||||
# transpose of diffses has shape (xs, j, measurement_idx, A)
|
||||
# numpy.transpose(diffses1)
|
||||
# _logger.info(f"dot product shape: {transp_intermediate_dot_prod.shape}")
|
||||
|
||||
# inner transpose is (j, measurement_idx, A) * (xs, j, measurement_idx, A)
|
||||
# next transpose puts it back to (A, measurement_idx, j, xs)
|
||||
# p_dot_r_times_r_term = 3 * numpy.transpose(numpy.transpose(numpy.einsum("abcd,acd->abc", diffses1, ps) / (norms1**3)) * numpy.transpose(diffses1))
|
||||
# _logger.info(f"p_dot_r_times_r_term: {p_dot_r_times_r_term.shape}")
|
||||
|
||||
# only x axis puts us at (A, measurement_idx, j)
|
||||
# p_dot_r_times_r_term_x_only = p_dot_r_times_r_term[:, :, :, 0]
|
||||
# _logger.info(f"p_dot_r_times_r_term_x_only.shape: {p_dot_r_times_r_term_x_only.shape}")
|
||||
|
||||
# now to complete the numerator we subtract the ps, which are (A, j, px):
|
||||
# slicing off the end gives us (A, j), so we newaxis to get (A, 1, j)
|
||||
# _logger.info(ps[:, numpy.newaxis, :, 0].shape)
|
||||
alphses1 = (
|
||||
(
|
||||
3
|
||||
* numpy.transpose(
|
||||
numpy.transpose(
|
||||
numpy.einsum("abcd,acd->abc", diffses1, ps) / (norms1**2)
|
||||
)
|
||||
* numpy.transpose(diffses1)
|
||||
)[:, :, :, 0]
|
||||
)
|
||||
- ps[:, numpy.newaxis, :, 0]
|
||||
) / (norms1**3)
|
||||
alphses2 = (
|
||||
(
|
||||
3
|
||||
* numpy.transpose(
|
||||
numpy.transpose(
|
||||
numpy.einsum("abcd,acd->abc", diffses2, ps) / (norms2**2)
|
||||
)
|
||||
* numpy.transpose(diffses2)
|
||||
)[:, :, :, 0]
|
||||
)
|
||||
- ps[:, numpy.newaxis, :, 0]
|
||||
) / (norms2**3)
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"alphses1: {alphses1}")
|
||||
_logger.debug(f"alphses2: {alphses2}")
|
||||
|
||||
# ws has shape (A, j), so it becomes (A, 1, j) in numerator with the new axis
|
||||
# f1s has shape (m), so we get in the denominator (m, 1) + (A, 1, j)
|
||||
# This becomes (A, m, j)
|
||||
bses = 2 * ws[:, None, :] / ((numpy.pi * f1s[:, None]) ** 2 + ws[:, None, :] ** 2)
|
||||
if _logger.isEnabledFor(logging.DEBUG):
|
||||
_logger.debug(f"bses: {bses}")
|
||||
|
||||
# alphas have (A, 1, j), betas have (A, m, j)
|
||||
# Final result is (A, m, j)
|
||||
_logger.debug(f"Raw pair calc: [{alphses1 * alphses2 * bses}]")
|
||||
return numpy.einsum("...j->...", alphses1 * alphses2 * bses)
|
||||
|
||||
|
||||
def signarg(x, **kwargs):
|
||||
"""
|
||||
uses numpy.sign to implement Arg for real numbers only. Should return pi for negative inputs, 0 for positive.
|
||||
Passes through args to numpy.sign
|
||||
"""
|
||||
return numpy.pi * (numpy.sign(x, **kwargs) - 1) / (-2)
|
252
pdme/util/fast_v_calc.py
Normal file
252
pdme/util/fast_v_calc.py
Normal file
@ -0,0 +1,252 @@
|
||||
import numpy
|
||||
import logging
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def fast_vs_for_dipoles(
|
||||
dot_inputs: numpy.ndarray, dipoles: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
Expects dot_inputs to be numpy array of [rx, ry, rz, f] entries, so a n by 4 where n is number of measurement points.
|
||||
"""
|
||||
# name indexes:
|
||||
# A: dipole config index
|
||||
# cart: cartesian index
|
||||
# m: measurement index
|
||||
|
||||
# [A, cart]
|
||||
ps = dipoles[:, 0:3]
|
||||
ss = dipoles[:, 3:6]
|
||||
# [A]
|
||||
ws = dipoles[:, 6]
|
||||
|
||||
_logger.debug(f"ps: {ps}")
|
||||
_logger.debug(f"ss: {ss}")
|
||||
_logger.debug(f"ws: {ws}")
|
||||
|
||||
# [m, cart]
|
||||
rs = dot_inputs[:, 0:3]
|
||||
# [m]
|
||||
fs = dot_inputs[:, 3]
|
||||
|
||||
# [m, cart] - [A, 1, cart]
|
||||
# [A, m, cart]
|
||||
diffses = rs - ss[:, None]
|
||||
|
||||
_logger.debug(f"diffses: {diffses}")
|
||||
# [A, m]
|
||||
norms = numpy.linalg.norm(diffses, axis=2) ** 3
|
||||
_logger.debug(f"norms: {norms}")
|
||||
# [A, m, cart] [A, cart] -> [A, m]
|
||||
ases = (numpy.einsum("...ji, ...i", diffses, ps) / norms) ** 2
|
||||
_logger.debug(f"ases: {ases}")
|
||||
|
||||
# [A, 1], denom [m] + [A, 1] -> [A, m]
|
||||
# [A, m]
|
||||
bses = 2 * ws[:, None] / ((numpy.pi * fs) ** 2 + ws[:, None] ** 2)
|
||||
|
||||
_logger.debug(f"bses: {bses}")
|
||||
# returns shape [A, m]
|
||||
return ases * bses
|
||||
|
||||
|
||||
def fast_vs_for_dipoleses(
|
||||
dot_inputs: numpy.ndarray, dipoleses: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
Expects dot_inputs to be numpy array of [rx, ry, rz, f] entries, so a n by 4 where n is number of measurement points.
|
||||
|
||||
Dipoleses are expected to be array of arrays of arrays: list of sets of dipoles which are part of a single arrangement to be added together.
|
||||
"""
|
||||
ps = dipoleses[:, :, 0:3]
|
||||
ss = dipoleses[:, :, 3:6]
|
||||
ws = dipoleses[:, :, 6]
|
||||
|
||||
_logger.debug(f"ps: {ps}")
|
||||
_logger.debug(f"ss: {ss}")
|
||||
_logger.debug(f"ws: {ws}")
|
||||
|
||||
rs = dot_inputs[:, 0:3]
|
||||
fs = dot_inputs[:, 3]
|
||||
|
||||
diffses = rs[:, None] - ss[:, None, :]
|
||||
|
||||
_logger.debug(f"diffses: {diffses}")
|
||||
norms = numpy.linalg.norm(diffses, axis=3) ** 3
|
||||
_logger.debug(f"norms: {norms}")
|
||||
ases = (numpy.einsum("abcd,acd->abc", diffses, ps) / norms) ** 2
|
||||
_logger.debug(f"ases: {ases}")
|
||||
|
||||
bses = 2 * ws[:, None, :] / ((numpy.pi * fs[:, None]) ** 2 + ws[:, None, :] ** 2)
|
||||
_logger.debug(f"bses: {bses}")
|
||||
return numpy.einsum("...j->...", ases * bses)
|
||||
|
||||
|
||||
def fast_efieldxs_for_dipoles(
|
||||
dot_inputs: numpy.ndarray, dipoles: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
Expects dot_inputs to be numpy array of [rx, ry, rz, f] entries, so a n by 4 where n is number of measurement points.
|
||||
"""
|
||||
# name indexes:
|
||||
# A: dipole config index
|
||||
# j: dipole index within a config
|
||||
# cart: cartesian index
|
||||
# m: measurement index
|
||||
|
||||
# Indexes [A, cart]
|
||||
ps = dipoles[:, 0:3]
|
||||
ss = dipoles[:, 3:6]
|
||||
# Indexes [A]
|
||||
ws = dipoles[:, 6]
|
||||
|
||||
# Indexes [m, cart]
|
||||
rs = dot_inputs[:, 0:3]
|
||||
# Indexes [m]
|
||||
fs = dot_inputs[:, 3]
|
||||
|
||||
# Indexes [m, cart] - [A, 1, cart]
|
||||
# Broadcasting from right
|
||||
# diffses.indexes [A, m, cart]
|
||||
diffses = rs - ss[:, None, :]
|
||||
|
||||
# [A, m, cart][2] = cart
|
||||
# norms takes out axis 2, the last one, giving [A, m]
|
||||
norms = numpy.linalg.norm(diffses, axis=2)
|
||||
|
||||
# long story but this ends up becoming (A, 1, j)
|
||||
# Some evidence is looking at ps term, which has shape (A, 1, j, cart=0) becoming (A, 1, j)
|
||||
|
||||
# [A, m, cart] einsum [A, cart] explicitly gives [A, m]
|
||||
dot_products = numpy.einsum("amc,ac->am", diffses, ps) / (norms**2)
|
||||
|
||||
# [m, A] * [cart, m, A] -> [cart, m, A], transpose that and you get [A, m, cart]
|
||||
projections = numpy.transpose(
|
||||
numpy.transpose(dot_products) * numpy.transpose(diffses)
|
||||
)
|
||||
|
||||
# numerator [A, m, cart] - [A, 1, cart] -> [A, m, cart][:, :, 0] -> [A, m]
|
||||
alphas = (3 * projections - ps[:, numpy.newaxis])[:, :, 0] / norms**3
|
||||
|
||||
# [A, m]
|
||||
ases = alphas**2
|
||||
|
||||
# [A, 1], denom [m] + [A, 1] -> [A, m]
|
||||
# [A, m]
|
||||
bses = 2 * ws[:, None] / ((numpy.pi * fs) ** 2 + ws[:, None] ** 2)
|
||||
|
||||
# return shape [A, m, j]
|
||||
return ases * bses
|
||||
|
||||
|
||||
def fast_efieldxs_for_dipoleses(
|
||||
dot_inputs: numpy.ndarray, dipoleses: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
Expects dot_inputs to be numpy array of [rx, ry, rz, f] entries, so a n by 4 where n is number of measurement points.
|
||||
|
||||
Dipoleses are expected to be array of arrays of arrays:
|
||||
list of sets of dipoles which are part of a single arrangement to be added together.
|
||||
"""
|
||||
# name indexes:
|
||||
# A: dipole config index
|
||||
# j: dipole index within a config
|
||||
# cart: cartesian index
|
||||
# m: measurement index
|
||||
|
||||
# Indexes [A, j, cart]
|
||||
ps = dipoleses[:, :, 0:3]
|
||||
ss = dipoleses[:, :, 3:6]
|
||||
# Indexes [A, j]
|
||||
ws = dipoleses[:, :, 6]
|
||||
|
||||
# Indexes [m, cart]
|
||||
rs = dot_inputs[:, 0:3]
|
||||
# Indexes [m]
|
||||
fs = dot_inputs[:, 3]
|
||||
|
||||
# Indexes [m, 1, cart] - [A, 1, j, cart]
|
||||
# Broadcasting from right
|
||||
# diffses.indexes [A, m, j, cart]
|
||||
diffses = rs[:, None] - ss[:, None, :]
|
||||
|
||||
# norms takes out axis 3, the last one, giving [A, m, j]
|
||||
norms = numpy.linalg.norm(diffses, axis=3)
|
||||
|
||||
# long story but this ends up becoming (A, 1, j)
|
||||
# Some evidence is looking at ps term, which has shape (A, 1, j, cart=0) becoming (A, 1, j)
|
||||
alphas = (
|
||||
(
|
||||
3
|
||||
* numpy.transpose(
|
||||
numpy.transpose(
|
||||
numpy.einsum("abcd,acd->abc", diffses, ps) / (norms**2)
|
||||
)
|
||||
* numpy.transpose(diffses)
|
||||
)[:, :, :, 0]
|
||||
)
|
||||
- ps[:, numpy.newaxis, :, 0]
|
||||
) / (norms**3)
|
||||
ases = alphas**2
|
||||
# bses.shape [A, m, j)]
|
||||
bses = 2 * ws[:, None, :] / ((numpy.pi * fs[:, None]) ** 2 + ws[:, None, :] ** 2)
|
||||
|
||||
# return shape [A, m, j]
|
||||
return numpy.einsum("...j->...", ases * bses)
|
||||
|
||||
|
||||
def fast_vs_for_asymmetric_dipoleses(
|
||||
dot_inputs: numpy.ndarray, dipoleses: numpy.ndarray, temp: numpy.ndarray
|
||||
) -> numpy.ndarray:
|
||||
"""
|
||||
No error correction here baby.
|
||||
Expects dot_inputs to be numpy array of [rx, ry, rz, f] entries, so a n by 4 where n is number of measurement points.
|
||||
|
||||
Dipoleses are expected to be array of arrays of arrays:
|
||||
list of sets of dipoles which are part of a single arrangement to be added together.
|
||||
Within each dipole, the expected format is [px, py, pz, sx, sy, sz, e1, e2, w]
|
||||
The passed in w is expected to be half the actual. This is bad, but here for historical reasons to be changed later.
|
||||
"""
|
||||
raw_ps = dipoleses[:, :, 0:3]
|
||||
ss = dipoleses[:, :, 3:6]
|
||||
e1s = dipoleses[:, :, 6]
|
||||
e2s = dipoleses[:, :, 7]
|
||||
raw_ws = dipoleses[:, :, 8]
|
||||
|
||||
rs = dot_inputs[:, 0:3]
|
||||
fs = dot_inputs[:, 3]
|
||||
|
||||
diffses = rs[:, None] - ss[:, None, :]
|
||||
|
||||
_logger.warning(
|
||||
"This method is very likely to be broken, and should not be used without more thought"
|
||||
)
|
||||
w1s = numpy.exp(-e1s / temp) * raw_ws
|
||||
w2s = numpy.exp(-e2s / temp) * raw_ws
|
||||
|
||||
mag_prefactor = 4 * ((w1s * w2s) / ((w1s + w2s) ** 2))
|
||||
ws = w1s + w2s
|
||||
|
||||
# some annoying broadcast thing here?
|
||||
ps = (raw_ps.T * mag_prefactor.T).T
|
||||
|
||||
norms = numpy.linalg.norm(diffses, axis=3) ** 3
|
||||
|
||||
ases = (numpy.einsum("abcd,acd->abc", diffses, ps) / norms) ** 2
|
||||
|
||||
bses = ws[:, None, :] / ((numpy.pi * fs[:, None]) ** 2 + ws[:, None, :] ** 2)
|
||||
|
||||
return numpy.einsum("...j->...", ases * bses)
|
||||
|
||||
|
||||
def between(a: numpy.ndarray, low: numpy.ndarray, high: numpy.ndarray) -> numpy.ndarray:
|
||||
"""
|
||||
Intended specifically for the case where a is a list of arrays, and each array must be between the single array low and high, but without error checking.
|
||||
"""
|
||||
return numpy.all(numpy.logical_and(low < a, high > a), axis=1)
|
@ -1,29 +0,0 @@
|
||||
import numpy
|
||||
import operator
|
||||
import logging
|
||||
|
||||
|
||||
# flips px, py, pz
|
||||
SIGN_ARRAY_7 = numpy.array((-1, -1, -1, 1, 1, 1, 1))
|
||||
SIGN_ARRAY_4 = numpy.array((-1, 1, 1, 1))
|
||||
|
||||
|
||||
def flip_chunk_to_positive_px(pt: numpy.ndarray) -> numpy.ndarray:
|
||||
if pt[0] > 0:
|
||||
return pt
|
||||
else:
|
||||
# godawful hack.
|
||||
if len(pt) == 7:
|
||||
return SIGN_ARRAY_7 * pt
|
||||
elif len(pt) == 4:
|
||||
return SIGN_ARRAY_4 * pt
|
||||
else:
|
||||
logging.warning(f"Could not normalise pt: {pt}. Returning as is...")
|
||||
return pt
|
||||
|
||||
|
||||
def normalise_point_list(pts: numpy.ndarray, pt_length) -> numpy.ndarray:
|
||||
chunked_pts = [flip_chunk_to_positive_px(pts[i: i + pt_length]) for i in range(0, len(pts), pt_length)]
|
||||
range_to_length = list(range(pt_length))
|
||||
rotated_range = range_to_length[pt_length - 1:] + range_to_length[0:pt_length - 1]
|
||||
return numpy.concatenate(sorted(chunked_pts, key=lambda x: tuple(round(val, 3) for val in operator.itemgetter(*rotated_range)(x))), axis=None)
|
628
poetry.lock
generated
628
poetry.lock
generated
@ -1,24 +1,65 @@
|
||||
[[package]]
|
||||
name = "atomicwrites"
|
||||
version = "1.4.0"
|
||||
description = "Atomic file writes."
|
||||
name = "appnope"
|
||||
version = "0.1.2"
|
||||
description = "Disable App Nap on macOS >= 10.9"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "21.4.0"
|
||||
description = "Classes Without Boilerplate"
|
||||
name = "asttokens"
|
||||
version = "2.0.5"
|
||||
description = "Annotate AST trees with source code positions"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
six = "*"
|
||||
|
||||
[package.extras]
|
||||
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"]
|
||||
docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"]
|
||||
tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"]
|
||||
tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"]
|
||||
test = ["astroid", "pytest"]
|
||||
|
||||
[[package]]
|
||||
name = "backcall"
|
||||
version = "0.2.0"
|
||||
description = "Specifications for callback functions passed in to an API"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "black"
|
||||
version = "22.3.0"
|
||||
description = "The uncompromising code formatter."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6.2"
|
||||
|
||||
[package.dependencies]
|
||||
click = ">=8.0.0"
|
||||
mypy-extensions = ">=0.4.3"
|
||||
pathspec = ">=0.9.0"
|
||||
platformdirs = ">=2"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""}
|
||||
|
||||
[package.extras]
|
||||
colorama = ["colorama (>=0.4.3)"]
|
||||
d = ["aiohttp (>=3.7.4)"]
|
||||
jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"]
|
||||
uvloop = ["uvloop (>=0.15.2)"]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.1.2"
|
||||
description = "Composable command line interface toolkit"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
@ -28,29 +69,67 @@ category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
|
||||
[[package]]
|
||||
name = "colored"
|
||||
version = "1.4.4"
|
||||
description = "Simple library for color and formatting to terminal"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "coverage"
|
||||
version = "6.2"
|
||||
version = "7.2.7"
|
||||
description = "Code coverage measurement for Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""}
|
||||
|
||||
[package.extras]
|
||||
toml = ["tomli"]
|
||||
|
||||
[[package]]
|
||||
name = "decorator"
|
||||
version = "5.1.1"
|
||||
description = "Decorators for Humans"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[[package]]
|
||||
name = "exceptiongroup"
|
||||
version = "1.1.2"
|
||||
description = "Backport of PEP 654 (exception groups)"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
test = ["pytest (>=6)"]
|
||||
|
||||
[[package]]
|
||||
name = "executing"
|
||||
version = "0.8.3"
|
||||
description = "Get the currently executing AST node of a frame, and other information"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "flake8"
|
||||
version = "3.9.2"
|
||||
version = "4.0.1"
|
||||
description = "the modular source code checker: pep8 pyflakes and co"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
mccabe = ">=0.6.0,<0.7.0"
|
||||
pycodestyle = ">=2.7.0,<2.8.0"
|
||||
pyflakes = ">=2.3.0,<2.4.0"
|
||||
pycodestyle = ">=2.8.0,<2.9.0"
|
||||
pyflakes = ">=2.4.0,<2.5.0"
|
||||
|
||||
[[package]]
|
||||
name = "iniconfig"
|
||||
@ -60,6 +139,67 @@ category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "ipython"
|
||||
version = "8.2.0"
|
||||
description = "IPython: Productive Interactive Computing"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
|
||||
[package.dependencies]
|
||||
appnope = {version = "*", markers = "sys_platform == \"darwin\""}
|
||||
backcall = "*"
|
||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
decorator = "*"
|
||||
jedi = ">=0.16"
|
||||
matplotlib-inline = "*"
|
||||
pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""}
|
||||
pickleshare = "*"
|
||||
prompt-toolkit = ">=2.0.0,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.1.0"
|
||||
pygments = ">=2.4.0"
|
||||
stack-data = "*"
|
||||
traitlets = ">=5"
|
||||
|
||||
[package.extras]
|
||||
all = ["black", "Sphinx (>=1.3)", "ipykernel", "nbconvert", "nbformat", "ipywidgets", "notebook", "ipyparallel", "qtconsole", "pytest (<7.1)", "pytest-asyncio", "testpath", "curio", "matplotlib (!=3.2.0)", "numpy (>=1.19)", "pandas", "trio"]
|
||||
black = ["black"]
|
||||
doc = ["Sphinx (>=1.3)"]
|
||||
kernel = ["ipykernel"]
|
||||
nbconvert = ["nbconvert"]
|
||||
nbformat = ["nbformat"]
|
||||
notebook = ["ipywidgets", "notebook"]
|
||||
parallel = ["ipyparallel"]
|
||||
qtconsole = ["qtconsole"]
|
||||
test = ["pytest (<7.1)", "pytest-asyncio", "testpath"]
|
||||
test_extra = ["pytest (<7.1)", "pytest-asyncio", "testpath", "curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.19)", "pandas", "trio"]
|
||||
|
||||
[[package]]
|
||||
name = "jedi"
|
||||
version = "0.18.1"
|
||||
description = "An autocompletion tool for Python that can be used for text editors."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
parso = ">=0.8.0,<0.9.0"
|
||||
|
||||
[package.extras]
|
||||
qa = ["flake8 (==3.8.3)", "mypy (==0.782)"]
|
||||
testing = ["Django (<3.1)", "colorama", "docopt", "pytest (<7.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "matplotlib-inline"
|
||||
version = "0.1.3"
|
||||
description = "Inline Matplotlib backend for Jupyter"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[package.dependencies]
|
||||
traitlets = "*"
|
||||
|
||||
[[package]]
|
||||
name = "mccabe"
|
||||
version = "0.6.1"
|
||||
@ -70,20 +210,21 @@ python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "mypy"
|
||||
version = "0.910"
|
||||
version = "0.961"
|
||||
description = "Optional static typing for Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.5"
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
mypy-extensions = ">=0.4.3,<0.5.0"
|
||||
toml = "*"
|
||||
typing-extensions = ">=3.7.4"
|
||||
mypy-extensions = ">=0.4.3"
|
||||
tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
|
||||
typing-extensions = ">=3.10"
|
||||
|
||||
[package.extras]
|
||||
dmypy = ["psutil (>=4.0)"]
|
||||
python2 = ["typed-ast (>=1.4.0,<1.5.0)"]
|
||||
python2 = ["typed-ast (>=1.4.0,<2)"]
|
||||
reports = ["lxml"]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
@ -95,7 +236,7 @@ python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "numpy"
|
||||
version = "1.22.0"
|
||||
version = "1.22.3"
|
||||
description = "NumPy is the fundamental package for array computing with Python."
|
||||
category = "main"
|
||||
optional = false
|
||||
@ -112,6 +253,57 @@ python-versions = ">=3.6"
|
||||
[package.dependencies]
|
||||
pyparsing = ">=2.0.2,<3.0.5 || >3.0.5"
|
||||
|
||||
[[package]]
|
||||
name = "parso"
|
||||
version = "0.8.3"
|
||||
description = "A Python Parser"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.extras]
|
||||
qa = ["flake8 (==3.8.3)", "mypy (==0.782)"]
|
||||
testing = ["docopt", "pytest (<6.0.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "0.9.0"
|
||||
description = "Utility library for gitignore style pattern matching of file paths."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
|
||||
|
||||
[[package]]
|
||||
name = "pexpect"
|
||||
version = "4.8.0"
|
||||
description = "Pexpect allows easy control of interactive console applications."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
ptyprocess = ">=0.5"
|
||||
|
||||
[[package]]
|
||||
name = "pickleshare"
|
||||
version = "0.7.5"
|
||||
description = "Tiny 'shelve'-like database with concurrency support"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "2.5.1"
|
||||
description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"]
|
||||
test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.0.0"
|
||||
@ -125,28 +317,58 @@ dev = ["pre-commit", "tox"]
|
||||
testing = ["pytest", "pytest-benchmark"]
|
||||
|
||||
[[package]]
|
||||
name = "py"
|
||||
version = "1.11.0"
|
||||
description = "library with cross-python path, ini-parsing, io, code, log facilities"
|
||||
name = "prompt-toolkit"
|
||||
version = "3.0.28"
|
||||
description = "Library for building powerful interactive command lines in Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6.2"
|
||||
|
||||
[package.dependencies]
|
||||
wcwidth = "*"
|
||||
|
||||
[[package]]
|
||||
name = "ptyprocess"
|
||||
version = "0.7.0"
|
||||
description = "Run a subprocess in a pseudo terminal"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[[package]]
|
||||
name = "pure-eval"
|
||||
version = "0.2.2"
|
||||
description = "Safely evaluate AST nodes without side effects"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.extras]
|
||||
tests = ["pytest"]
|
||||
|
||||
[[package]]
|
||||
name = "pycodestyle"
|
||||
version = "2.8.0"
|
||||
description = "Python style guide checker"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
|
||||
[[package]]
|
||||
name = "pycodestyle"
|
||||
version = "2.7.0"
|
||||
description = "Python style guide checker"
|
||||
name = "pyflakes"
|
||||
version = "2.4.0"
|
||||
description = "passive checker of Python programs"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
|
||||
[[package]]
|
||||
name = "pyflakes"
|
||||
version = "2.3.1"
|
||||
description = "passive checker of Python programs"
|
||||
name = "pygments"
|
||||
version = "2.11.2"
|
||||
description = "Pygments is a syntax highlighting package written in Python."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
python-versions = ">=3.5"
|
||||
|
||||
[[package]]
|
||||
name = "pyparsing"
|
||||
@ -161,59 +383,108 @@ diagrams = ["jinja2", "railroad-diagrams"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "6.2.5"
|
||||
version = "7.4.0"
|
||||
description = "pytest: simple powerful testing with Python"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""}
|
||||
attrs = ">=19.2.0"
|
||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
||||
iniconfig = "*"
|
||||
packaging = "*"
|
||||
pluggy = ">=0.12,<2.0"
|
||||
py = ">=1.8.2"
|
||||
toml = "*"
|
||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"]
|
||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-cov"
|
||||
version = "2.12.1"
|
||||
version = "4.1.0"
|
||||
description = "Pytest plugin for measuring coverage."
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.dependencies]
|
||||
coverage = ">=5.2.1"
|
||||
coverage = {version = ">=5.2.1", extras = ["toml"]}
|
||||
pytest = ">=4.6"
|
||||
toml = "*"
|
||||
|
||||
[package.extras]
|
||||
testing = ["fields", "hunter", "process-tests", "six", "pytest-xdist", "virtualenv"]
|
||||
|
||||
[[package]]
|
||||
name = "scipy"
|
||||
version = "1.5.4"
|
||||
description = "SciPy: Scientific Library for Python"
|
||||
version = "1.10.0"
|
||||
description = "Fundamental algorithms for scientific computing in Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
python-versions = "<3.12,>=3.8"
|
||||
|
||||
[package.dependencies]
|
||||
numpy = ">=1.14.5"
|
||||
numpy = ">=1.19.5,<1.27.0"
|
||||
|
||||
[package.extras]
|
||||
test = ["pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "asv", "mpmath", "gmpy2", "threadpoolctl", "scikit-umfpack", "pooch"]
|
||||
doc = ["sphinx (!=4.1.0)", "pydata-sphinx-theme (==0.9.0)", "sphinx-design (>=0.2.0)", "matplotlib (>2)", "numpydoc"]
|
||||
dev = ["mypy", "typing-extensions", "pycodestyle", "flake8", "rich-click", "click", "doit (>=0.36.0)", "pydevtool"]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.10.2"
|
||||
description = "Python Library for Tom's Obvious, Minimal Language"
|
||||
name = "six"
|
||||
version = "1.16.0"
|
||||
description = "Python 2 and 3 compatibility utilities"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
|
||||
[[package]]
|
||||
name = "stack-data"
|
||||
version = "0.2.0"
|
||||
description = "Extract data from python stack frames and tracebacks for informative displays"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
asttokens = "*"
|
||||
executing = "*"
|
||||
pure-eval = "*"
|
||||
|
||||
[package.extras]
|
||||
tests = ["pytest", "typeguard", "pygments", "littleutils", "cython"]
|
||||
|
||||
[[package]]
|
||||
name = "syrupy"
|
||||
version = "4.0.8"
|
||||
description = "Pytest Snapshot Test Utility"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.8.1,<4"
|
||||
|
||||
[package.dependencies]
|
||||
colored = ">=1.3.92,<2.0.0"
|
||||
pytest = ">=7.0.0,<8.0.0"
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
description = "A lil' TOML parser"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[[package]]
|
||||
name = "traitlets"
|
||||
version = "5.1.1"
|
||||
description = "Traitlets Python configuration system"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
|
||||
[package.extras]
|
||||
test = ["pytest"]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
@ -223,202 +494,61 @@ category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[[package]]
|
||||
name = "wcwidth"
|
||||
version = "0.2.5"
|
||||
description = "Measures the displayed width of unicode strings in a terminal"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.8,<3.10"
|
||||
content-hash = "1f00423d851dd44448cfd16f1b00f1672664d766f8add03a4c927f01f39cea80"
|
||||
python-versions = ">=3.8.1,<3.10"
|
||||
content-hash = "b5275c33449e8f85acbf9c0f6dfe1ec4e7296adfa16360d782b33534e1223638"
|
||||
|
||||
[metadata.files]
|
||||
atomicwrites = [
|
||||
{file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"},
|
||||
{file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"},
|
||||
]
|
||||
attrs = [
|
||||
{file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"},
|
||||
{file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"},
|
||||
]
|
||||
colorama = [
|
||||
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
|
||||
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
|
||||
]
|
||||
coverage = [
|
||||
{file = "coverage-6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6dbc1536e105adda7a6312c778f15aaabe583b0e9a0b0a324990334fd458c94b"},
|
||||
{file = "coverage-6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:174cf9b4bef0db2e8244f82059a5a72bd47e1d40e71c68ab055425172b16b7d0"},
|
||||
{file = "coverage-6.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:92b8c845527eae547a2a6617d336adc56394050c3ed8a6918683646328fbb6da"},
|
||||
{file = "coverage-6.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c7912d1526299cb04c88288e148c6c87c0df600eca76efd99d84396cfe00ef1d"},
|
||||
{file = "coverage-6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d5d2033d5db1d58ae2d62f095e1aefb6988af65b4b12cb8987af409587cc0739"},
|
||||
{file = "coverage-6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:3feac4084291642165c3a0d9eaebedf19ffa505016c4d3db15bfe235718d4971"},
|
||||
{file = "coverage-6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:276651978c94a8c5672ea60a2656e95a3cce2a3f31e9fb2d5ebd4c215d095840"},
|
||||
{file = "coverage-6.2-cp310-cp310-win32.whl", hash = "sha256:f506af4f27def639ba45789fa6fde45f9a217da0be05f8910458e4557eed020c"},
|
||||
{file = "coverage-6.2-cp310-cp310-win_amd64.whl", hash = "sha256:3f7c17209eef285c86f819ff04a6d4cbee9b33ef05cbcaae4c0b4e8e06b3ec8f"},
|
||||
{file = "coverage-6.2-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:13362889b2d46e8d9f97c421539c97c963e34031ab0cb89e8ca83a10cc71ac76"},
|
||||
{file = "coverage-6.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:22e60a3ca5acba37d1d4a2ee66e051f5b0e1b9ac950b5b0cf4aa5366eda41d47"},
|
||||
{file = "coverage-6.2-cp311-cp311-win_amd64.whl", hash = "sha256:b637c57fdb8be84e91fac60d9325a66a5981f8086c954ea2772efe28425eaf64"},
|
||||
{file = "coverage-6.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f467bbb837691ab5a8ca359199d3429a11a01e6dfb3d9dcc676dc035ca93c0a9"},
|
||||
{file = "coverage-6.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2641f803ee9f95b1f387f3e8f3bf28d83d9b69a39e9911e5bfee832bea75240d"},
|
||||
{file = "coverage-6.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1219d760ccfafc03c0822ae2e06e3b1248a8e6d1a70928966bafc6838d3c9e48"},
|
||||
{file = "coverage-6.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9a2b5b52be0a8626fcbffd7e689781bf8c2ac01613e77feda93d96184949a98e"},
|
||||
{file = "coverage-6.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:8e2c35a4c1f269704e90888e56f794e2d9c0262fb0c1b1c8c4ee44d9b9e77b5d"},
|
||||
{file = "coverage-6.2-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:5d6b09c972ce9200264c35a1d53d43ca55ef61836d9ec60f0d44273a31aa9f17"},
|
||||
{file = "coverage-6.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e3db840a4dee542e37e09f30859f1612da90e1c5239a6a2498c473183a50e781"},
|
||||
{file = "coverage-6.2-cp36-cp36m-win32.whl", hash = "sha256:4e547122ca2d244f7c090fe3f4b5a5861255ff66b7ab6d98f44a0222aaf8671a"},
|
||||
{file = "coverage-6.2-cp36-cp36m-win_amd64.whl", hash = "sha256:01774a2c2c729619760320270e42cd9e797427ecfddd32c2a7b639cdc481f3c0"},
|
||||
{file = "coverage-6.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:fb8b8ee99b3fffe4fd86f4c81b35a6bf7e4462cba019997af2fe679365db0c49"},
|
||||
{file = "coverage-6.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:619346d57c7126ae49ac95b11b0dc8e36c1dd49d148477461bb66c8cf13bb521"},
|
||||
{file = "coverage-6.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0a7726f74ff63f41e95ed3a89fef002916c828bb5fcae83b505b49d81a066884"},
|
||||
{file = "coverage-6.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cfd9386c1d6f13b37e05a91a8583e802f8059bebfccde61a418c5808dea6bbfa"},
|
||||
{file = "coverage-6.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:17e6c11038d4ed6e8af1407d9e89a2904d573be29d51515f14262d7f10ef0a64"},
|
||||
{file = "coverage-6.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c254b03032d5a06de049ce8bca8338a5185f07fb76600afff3c161e053d88617"},
|
||||
{file = "coverage-6.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dca38a21e4423f3edb821292e97cec7ad38086f84313462098568baedf4331f8"},
|
||||
{file = "coverage-6.2-cp37-cp37m-win32.whl", hash = "sha256:600617008aa82032ddeace2535626d1bc212dfff32b43989539deda63b3f36e4"},
|
||||
{file = "coverage-6.2-cp37-cp37m-win_amd64.whl", hash = "sha256:bf154ba7ee2fd613eb541c2bc03d3d9ac667080a737449d1a3fb342740eb1a74"},
|
||||
{file = "coverage-6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f9afb5b746781fc2abce26193d1c817b7eb0e11459510fba65d2bd77fe161d9e"},
|
||||
{file = "coverage-6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edcada2e24ed68f019175c2b2af2a8b481d3d084798b8c20d15d34f5c733fa58"},
|
||||
{file = "coverage-6.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a9c8c4283e17690ff1a7427123ffb428ad6a52ed720d550e299e8291e33184dc"},
|
||||
{file = "coverage-6.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f614fc9956d76d8a88a88bb41ddc12709caa755666f580af3a688899721efecd"},
|
||||
{file = "coverage-6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9365ed5cce5d0cf2c10afc6add145c5037d3148585b8ae0e77cc1efdd6aa2953"},
|
||||
{file = "coverage-6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8bdfe9ff3a4ea37d17f172ac0dff1e1c383aec17a636b9b35906babc9f0f5475"},
|
||||
{file = "coverage-6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:63c424e6f5b4ab1cf1e23a43b12f542b0ec2e54f99ec9f11b75382152981df57"},
|
||||
{file = "coverage-6.2-cp38-cp38-win32.whl", hash = "sha256:49dbff64961bc9bdd2289a2bda6a3a5a331964ba5497f694e2cbd540d656dc1c"},
|
||||
{file = "coverage-6.2-cp38-cp38-win_amd64.whl", hash = "sha256:9a29311bd6429be317c1f3fe4bc06c4c5ee45e2fa61b2a19d4d1d6111cb94af2"},
|
||||
{file = "coverage-6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:03b20e52b7d31be571c9c06b74746746d4eb82fc260e594dc662ed48145e9efd"},
|
||||
{file = "coverage-6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:215f8afcc02a24c2d9a10d3790b21054b58d71f4b3c6f055d4bb1b15cecce685"},
|
||||
{file = "coverage-6.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a4bdeb0a52d1d04123b41d90a4390b096f3ef38eee35e11f0b22c2d031222c6c"},
|
||||
{file = "coverage-6.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c332d8f8d448ded473b97fefe4a0983265af21917d8b0cdcb8bb06b2afe632c3"},
|
||||
{file = "coverage-6.2-cp39-cp39-win32.whl", hash = "sha256:6e1394d24d5938e561fbeaa0cd3d356207579c28bd1792f25a068743f2d5b282"},
|
||||
{file = "coverage-6.2-cp39-cp39-win_amd64.whl", hash = "sha256:86f2e78b1eff847609b1ca8050c9e1fa3bd44ce755b2ec30e70f2d3ba3844644"},
|
||||
{file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"},
|
||||
{file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"},
|
||||
]
|
||||
flake8 = [
|
||||
{file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"},
|
||||
{file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"},
|
||||
]
|
||||
iniconfig = [
|
||||
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
|
||||
{file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"},
|
||||
]
|
||||
mccabe = [
|
||||
{file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"},
|
||||
{file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"},
|
||||
]
|
||||
mypy = [
|
||||
{file = "mypy-0.910-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:a155d80ea6cee511a3694b108c4494a39f42de11ee4e61e72bc424c490e46457"},
|
||||
{file = "mypy-0.910-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:b94e4b785e304a04ea0828759172a15add27088520dc7e49ceade7834275bedb"},
|
||||
{file = "mypy-0.910-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:088cd9c7904b4ad80bec811053272986611b84221835e079be5bcad029e79dd9"},
|
||||
{file = "mypy-0.910-cp35-cp35m-win_amd64.whl", hash = "sha256:adaeee09bfde366d2c13fe6093a7df5df83c9a2ba98638c7d76b010694db760e"},
|
||||
{file = "mypy-0.910-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ecd2c3fe726758037234c93df7e98deb257fd15c24c9180dacf1ef829da5f921"},
|
||||
{file = "mypy-0.910-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d9dd839eb0dc1bbe866a288ba3c1afc33a202015d2ad83b31e875b5905a079b6"},
|
||||
{file = "mypy-0.910-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:3e382b29f8e0ccf19a2df2b29a167591245df90c0b5a2542249873b5c1d78212"},
|
||||
{file = "mypy-0.910-cp36-cp36m-win_amd64.whl", hash = "sha256:53fd2eb27a8ee2892614370896956af2ff61254c275aaee4c230ae771cadd885"},
|
||||
{file = "mypy-0.910-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b6fb13123aeef4a3abbcfd7e71773ff3ff1526a7d3dc538f3929a49b42be03f0"},
|
||||
{file = "mypy-0.910-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e4dab234478e3bd3ce83bac4193b2ecd9cf94e720ddd95ce69840273bf44f6de"},
|
||||
{file = "mypy-0.910-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:7df1ead20c81371ccd6091fa3e2878559b5c4d4caadaf1a484cf88d93ca06703"},
|
||||
{file = "mypy-0.910-cp37-cp37m-win_amd64.whl", hash = "sha256:0aadfb2d3935988ec3815952e44058a3100499f5be5b28c34ac9d79f002a4a9a"},
|
||||
{file = "mypy-0.910-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ec4e0cd079db280b6bdabdc807047ff3e199f334050db5cbb91ba3e959a67504"},
|
||||
{file = "mypy-0.910-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:119bed3832d961f3a880787bf621634ba042cb8dc850a7429f643508eeac97b9"},
|
||||
{file = "mypy-0.910-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:866c41f28cee548475f146aa4d39a51cf3b6a84246969f3759cb3e9c742fc072"},
|
||||
{file = "mypy-0.910-cp38-cp38-win_amd64.whl", hash = "sha256:ceb6e0a6e27fb364fb3853389607cf7eb3a126ad335790fa1e14ed02fba50811"},
|
||||
{file = "mypy-0.910-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a85e280d4d217150ce8cb1a6dddffd14e753a4e0c3cf90baabb32cefa41b59e"},
|
||||
{file = "mypy-0.910-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:42c266ced41b65ed40a282c575705325fa7991af370036d3f134518336636f5b"},
|
||||
{file = "mypy-0.910-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:3c4b8ca36877fc75339253721f69603a9c7fdb5d4d5a95a1a1b899d8b86a4de2"},
|
||||
{file = "mypy-0.910-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:c0df2d30ed496a08de5daed2a9ea807d07c21ae0ab23acf541ab88c24b26ab97"},
|
||||
{file = "mypy-0.910-cp39-cp39-win_amd64.whl", hash = "sha256:c6c2602dffb74867498f86e6129fd52a2770c48b7cd3ece77ada4fa38f94eba8"},
|
||||
{file = "mypy-0.910-py3-none-any.whl", hash = "sha256:ef565033fa5a958e62796867b1df10c40263ea9ded87164d67572834e57a174d"},
|
||||
{file = "mypy-0.910.tar.gz", hash = "sha256:704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150"},
|
||||
]
|
||||
mypy-extensions = [
|
||||
{file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"},
|
||||
{file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"},
|
||||
]
|
||||
numpy = [
|
||||
{file = "numpy-1.22.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3d22662b4b10112c545c91a0741f2436f8ca979ab3d69d03d19322aa970f9695"},
|
||||
{file = "numpy-1.22.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:11a1f3816ea82eed4178102c56281782690ab5993251fdfd75039aad4d20385f"},
|
||||
{file = "numpy-1.22.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5dc65644f75a4c2970f21394ad8bea1a844104f0fe01f278631be1c7eae27226"},
|
||||
{file = "numpy-1.22.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42c16cec1c8cf2728f1d539bd55aaa9d6bb48a7de2f41eb944697293ef65a559"},
|
||||
{file = "numpy-1.22.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97e82c39d9856fe7d4f9b86d8a1e66eff99cf3a8b7ba48202f659703d27c46f"},
|
||||
{file = "numpy-1.22.0-cp310-cp310-win_amd64.whl", hash = "sha256:e41e8951749c4b5c9a2dc5fdbc1a4eec6ab2a140fdae9b460b0f557eed870f4d"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:bece0a4a49e60e472a6d1f70ac6cdea00f9ab80ff01132f96bd970cdd8a9e5a9"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:818b9be7900e8dc23e013a92779135623476f44a0de58b40c32a15368c01d471"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:47ee7a839f5885bc0c63a74aabb91f6f40d7d7b639253768c4199b37aede7982"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a024181d7aef0004d76fb3bce2a4c9f2e67a609a9e2a6ff2571d30e9976aa383"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f71d57cc8645f14816ae249407d309be250ad8de93ef61d9709b45a0ddf4050c"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-win32.whl", hash = "sha256:283d9de87c0133ef98f93dfc09fad3fb382f2a15580de75c02b5bb36a5a159a5"},
|
||||
{file = "numpy-1.22.0-cp38-cp38-win_amd64.whl", hash = "sha256:2762331de395739c91f1abb88041f94a080cb1143aeec791b3b223976228af3f"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:76ba7c40e80f9dc815c5e896330700fd6e20814e69da9c1267d65a4d051080f1"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0cfe07133fd00b27edee5e6385e333e9eeb010607e8a46e1cd673f05f8596595"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6ed0d073a9c54ac40c41a9c2d53fcc3d4d4ed607670b9e7b0de1ba13b4cbfe6f"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41388e32e40b41dd56eb37fcaa7488b2b47b0adf77c66154d6b89622c110dfe9"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b55b953a1bdb465f4dc181758570d321db4ac23005f90ffd2b434cc6609a63dd"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-win32.whl", hash = "sha256:5a311ee4d983c487a0ab546708edbdd759393a3dc9cd30305170149fedd23c88"},
|
||||
{file = "numpy-1.22.0-cp39-cp39-win_amd64.whl", hash = "sha256:a97a954a8c2f046d3817c2bce16e3c7e9a9c2afffaf0400f5c16df5172a67c9c"},
|
||||
{file = "numpy-1.22.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb02929b0d6bfab4c48a79bd805bd7419114606947ec8284476167415171f55b"},
|
||||
{file = "numpy-1.22.0.zip", hash = "sha256:a955e4128ac36797aaffd49ab44ec74a71c11d6938df83b1285492d277db5397"},
|
||||
]
|
||||
packaging = [
|
||||
{file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
|
||||
{file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"},
|
||||
]
|
||||
pluggy = [
|
||||
{file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"},
|
||||
{file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"},
|
||||
]
|
||||
py = [
|
||||
{file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"},
|
||||
{file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"},
|
||||
]
|
||||
pycodestyle = [
|
||||
{file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"},
|
||||
{file = "pycodestyle-2.7.0.tar.gz", hash = "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c63ec26ebaf1cef"},
|
||||
]
|
||||
pyflakes = [
|
||||
{file = "pyflakes-2.3.1-py2.py3-none-any.whl", hash = "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905b22bbffe52efc3"},
|
||||
{file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"},
|
||||
]
|
||||
pyparsing = [
|
||||
{file = "pyparsing-3.0.6-py3-none-any.whl", hash = "sha256:04ff808a5b90911829c55c4e26f75fa5ca8a2f5f36aa3a51f68e27033341d3e4"},
|
||||
{file = "pyparsing-3.0.6.tar.gz", hash = "sha256:d9bdec0013ef1eb5a84ab39a3b3868911598afa494f5faa038647101504e2b81"},
|
||||
]
|
||||
pytest = [
|
||||
{file = "pytest-6.2.5-py3-none-any.whl", hash = "sha256:7310f8d27bc79ced999e760ca304d69f6ba6c6649c0b60fb0e04a4a77cacc134"},
|
||||
{file = "pytest-6.2.5.tar.gz", hash = "sha256:131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89"},
|
||||
]
|
||||
pytest-cov = [
|
||||
{file = "pytest-cov-2.12.1.tar.gz", hash = "sha256:261ceeb8c227b726249b376b8526b600f38667ee314f910353fa318caa01f4d7"},
|
||||
{file = "pytest_cov-2.12.1-py2.py3-none-any.whl", hash = "sha256:261bb9e47e65bd099c89c3edf92972865210c36813f80ede5277dceb77a4a62a"},
|
||||
]
|
||||
scipy = [
|
||||
{file = "scipy-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:4f12d13ffbc16e988fa40809cbbd7a8b45bc05ff6ea0ba8e3e41f6f4db3a9e47"},
|
||||
{file = "scipy-1.5.4-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:a254b98dbcc744c723a838c03b74a8a34c0558c9ac5c86d5561703362231107d"},
|
||||
{file = "scipy-1.5.4-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:368c0f69f93186309e1b4beb8e26d51dd6f5010b79264c0f1e9ca00cd92ea8c9"},
|
||||
{file = "scipy-1.5.4-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:4598cf03136067000855d6b44d7a1f4f46994164bcd450fb2c3d481afc25dd06"},
|
||||
{file = "scipy-1.5.4-cp36-cp36m-win32.whl", hash = "sha256:e98d49a5717369d8241d6cf33ecb0ca72deee392414118198a8e5b4c35c56340"},
|
||||
{file = "scipy-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:65923bc3809524e46fb7eb4d6346552cbb6a1ffc41be748535aa502a2e3d3389"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9ad4fcddcbf5dc67619379782e6aeef41218a79e17979aaed01ed099876c0e62"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:f87b39f4d69cf7d7529d7b1098cb712033b17ea7714aed831b95628f483fd012"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:25b241034215247481f53355e05f9e25462682b13bd9191359075682adcd9554"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:fa789583fc94a7689b45834453fec095245c7e69c58561dc159b5d5277057e4c"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-win32.whl", hash = "sha256:d6d25c41a009e3c6b7e757338948d0076ee1dd1770d1c09ec131f11946883c54"},
|
||||
{file = "scipy-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:2c872de0c69ed20fb1a9b9cf6f77298b04a26f0b8720a5457be08be254366c6e"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e360cb2299028d0b0d0f65a5c5e51fc16a335f1603aa2357c25766c8dab56938"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-manylinux1_i686.whl", hash = "sha256:3397c129b479846d7eaa18f999369a24322d008fac0782e7828fa567358c36ce"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:168c45c0c32e23f613db7c9e4e780bc61982d71dcd406ead746c7c7c2f2004ce"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:213bc59191da2f479984ad4ec39406bf949a99aba70e9237b916ce7547b6ef42"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-win32.whl", hash = "sha256:634568a3018bc16a83cda28d4f7aed0d803dd5618facb36e977e53b2df868443"},
|
||||
{file = "scipy-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:b03c4338d6d3d299e8ca494194c0ae4f611548da59e3c038813f1a43976cb437"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3d5db5d815370c28d938cf9b0809dade4acf7aba57eaf7ef733bfedc9b2474c4"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-manylinux1_i686.whl", hash = "sha256:6b0ceb23560f46dd236a8ad4378fc40bad1783e997604ba845e131d6c680963e"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:ed572470af2438b526ea574ff8f05e7f39b44ac37f712105e57fc4d53a6fb660"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:8c8d6ca19c8497344b810b0b0344f8375af5f6bb9c98bd42e33f747417ab3f57"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-win32.whl", hash = "sha256:d84cadd7d7998433334c99fa55bcba0d8b4aeff0edb123b2a1dfcface538e474"},
|
||||
{file = "scipy-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:cc1f78ebc982cd0602c9a7615d878396bec94908db67d4ecddca864d049112f2"},
|
||||
{file = "scipy-1.5.4.tar.gz", hash = "sha256:4a453d5e5689de62e5d38edf40af3f17560bfd63c9c5bd228c18c1f99afa155b"},
|
||||
]
|
||||
toml = [
|
||||
{file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
|
||||
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
|
||||
]
|
||||
typing-extensions = [
|
||||
{file = "typing_extensions-4.0.1-py3-none-any.whl", hash = "sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b"},
|
||||
{file = "typing_extensions-4.0.1.tar.gz", hash = "sha256:4ca091dea149f945ec56afb48dae714f21e8692ef22a395223bcd328961b6a0e"},
|
||||
]
|
||||
appnope = []
|
||||
asttokens = []
|
||||
backcall = []
|
||||
black = []
|
||||
click = []
|
||||
colorama = []
|
||||
colored = []
|
||||
coverage = []
|
||||
decorator = []
|
||||
exceptiongroup = []
|
||||
executing = []
|
||||
flake8 = []
|
||||
iniconfig = []
|
||||
ipython = []
|
||||
jedi = []
|
||||
matplotlib-inline = []
|
||||
mccabe = []
|
||||
mypy = []
|
||||
mypy-extensions = []
|
||||
numpy = []
|
||||
packaging = []
|
||||
parso = []
|
||||
pathspec = []
|
||||
pexpect = []
|
||||
pickleshare = []
|
||||
platformdirs = []
|
||||
pluggy = []
|
||||
prompt-toolkit = []
|
||||
ptyprocess = []
|
||||
pure-eval = []
|
||||
pycodestyle = []
|
||||
pyflakes = []
|
||||
pygments = []
|
||||
pyparsing = []
|
||||
pytest = []
|
||||
pytest-cov = []
|
||||
scipy = []
|
||||
six = []
|
||||
stack-data = []
|
||||
syrupy = []
|
||||
tomli = []
|
||||
traitlets = []
|
||||
typing-extensions = []
|
||||
wcwidth = []
|
||||
|
@ -1,30 +1,35 @@
|
||||
[tool.poetry]
|
||||
name = "pdme"
|
||||
version = "0.1.0"
|
||||
version = "1.5.0"
|
||||
description = "Python dipole model evaluator"
|
||||
authors = ["Deepak <dmallubhotla+github@gmail.com>"]
|
||||
license = "GPL-3.0-only"
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.8,<3.10"
|
||||
numpy = "^1.21.1"
|
||||
scipy = "~1.5"
|
||||
python = ">=3.8.1,<3.10"
|
||||
numpy = "^1.22.3"
|
||||
scipy = "~1.10"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
pytest = ">=6"
|
||||
flake8 = "^3.8.4"
|
||||
pytest-cov = "^2.10.1"
|
||||
mypy = "^0.910"
|
||||
flake8 = "^4.0.0"
|
||||
pytest-cov = "^4.1.0"
|
||||
mypy = "^0.961"
|
||||
ipython = "^8.2.0"
|
||||
black = "^22.3.0"
|
||||
syrupy = "^4.0.8"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry>=0.12"]
|
||||
build-backend = "poetry.masonry.api"
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
addopts = "--junitxml pytest.xml --cov pdme --cov-report=xml:coverage.xml --cov-fail-under=50 --cov-report=html"
|
||||
junit_family = "xunit1"
|
||||
log_format = "%(asctime)s | %(levelname)s | %(pathname)s:%(lineno)d | %(message)s"
|
||||
log_level = "WARNING"
|
||||
|
||||
[tool.mypy]
|
||||
plugins = "numpy.typing.mypy_plugin"
|
||||
|
3
renovate.json
Normal file
3
renovate.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
from pdme.model.fixed_z_plane_model import FixedZPlaneModel, FixedZPlaneDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import numpy
|
||||
import multiprocessing
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = FixedZPlaneModel(4, -10, 10, -10, 10, 1)
|
||||
discretisation = FixedZPlaneDiscretisation(model, 20, 20, 20, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,40 +0,0 @@
|
||||
from pdme.model.fixed_z_plane_model import FixedZPlaneModel, FixedZPlaneDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import numpy
|
||||
import multiprocessing
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((.5, 0, 2), (1, 2, 3), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = FixedZPlaneModel(4, -10, 10, -10, 10, 1)
|
||||
discretisation = FixedZPlaneDiscretisation(model, 20, 20, 20, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 0, 10, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 6, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((.5, 0, 2), (1, 2, 3), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((.5, 0, 2), (1, 2, 3), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 0, 10, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 6, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
# Working directory clean
|
||||
branch_name=$(git symbolic-ref -q HEAD)
|
||||
branch_name=${branch_name##refs/heads/}
|
||||
branch_name=${branch_name:-HEAD}
|
||||
|
||||
poetry version patch
|
||||
version=`sed 's/version = "\([0-9]*.[0-9]*.[0-9]*\)"/\1/p' -n <pyproject.toml`
|
||||
read -p "Create commit for version $version? " -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
# do dangerous stuff
|
||||
echo "Creating a new patch"
|
||||
git add pyproject.toml
|
||||
git commit -m "Created version $version"
|
||||
git tag -a "$version" -m "patch.sh created version $version"
|
||||
git push --tags
|
||||
else
|
||||
echo "Surrendering, clean up by reverting pyproject.toml..."
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "Can't create patch version, working tree unclean..."
|
||||
exit 1
|
||||
fi
|
45
scripts/release.sh
Normal file
45
scripts/release.sh
Normal file
@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
branch_name=$(git symbolic-ref -q HEAD)
|
||||
branch_name=${branch_name##refs/heads/}
|
||||
branch_name=${branch_name:-HEAD}
|
||||
if [ $branch_name != "master" ]; then
|
||||
echo "The current branch is not master!"
|
||||
echo "I'd feel uncomfortable releasing from here..."
|
||||
exit 3
|
||||
fi
|
||||
|
||||
release_needed=false
|
||||
if \
|
||||
{ git log "$( git describe --tags --abbrev=0 )..HEAD" --format='%s' | cut -d: -f1 | sort -u | sed -e 's/([^)]*)//' | grep -q -i -E '^feat|fix|perf|refactor|revert$' ; } || \
|
||||
{ git log "$( git describe --tags --abbrev=0 )..HEAD" --format='%s' | cut -d: -f1 | sort -u | sed -e 's/([^)]*)//' | grep -q -E '\!$' ; } || \
|
||||
{ git log "$( git describe --tags --abbrev=0 )..HEAD" --format='%b' | grep -q -E '^BREAKING CHANGE:' ; }
|
||||
then
|
||||
release_needed=true
|
||||
fi
|
||||
|
||||
if ! [ "$release_needed" = true ]; then
|
||||
echo "No release needed..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Working directory clean
|
||||
echo "Doing a dry run..."
|
||||
npx standard-version --dry-run
|
||||
read -p "Does that look good? [y/N] " -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
# do dangerous stuff
|
||||
npx standard-version
|
||||
git push --follow-tags origin master
|
||||
else
|
||||
echo "okay, never mind then..."
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "Can't create release, working tree unclean..."
|
||||
exit 1
|
||||
fi
|
11
scripts/standard-version/pyproject-updater.js
Normal file
11
scripts/standard-version/pyproject-updater.js
Normal file
@ -0,0 +1,11 @@
|
||||
const pattern = /(\[tool\.poetry\]\nname = "pdme"\nversion = ")(?<vers>\d+\.\d+\.\d+)(")/mg;
|
||||
|
||||
module.exports.readVersion = function (contents) {
|
||||
const result = pattern.exec(contents);
|
||||
return result.groups.vers;
|
||||
}
|
||||
|
||||
module.exports.writeVersion = function (contents, version) {
|
||||
const newContents = contents.replace(pattern, `$1${version}$3`);
|
||||
return newContents;
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
from pdme.model.fixed_dipole_model import FixedDipoleModel, FixedDipoleDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-dipole-middle-all-dots-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_pt():
|
||||
return ((1, 1, 1), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedDipoleModel(-10, 10, -10, 10, 2.5, 3.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_low = FixedDipoleDiscretisation(model_low, 5, 5, 5)
|
||||
|
||||
model_medium = FixedDipoleModel(-10, 10, -10, 10, 3.5, 4.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_medium = FixedDipoleDiscretisation(model_medium, 5, 5, 5)
|
||||
|
||||
model_high = FixedDipoleModel(-10, 10, -10, 10, 4.5, 5.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_high = FixedDipoleDiscretisation(model_high, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,108 +0,0 @@
|
||||
from pdme.model.fixed_dipole_model import FixedDipoleModel, FixedDipoleDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-dipole-middle-all-dots-narrower-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_pt():
|
||||
return ((1, 1, 1), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-.25, .25, 0], f), ([-.25, -.25, 0], f), ([.25, -.25, 0], f), ([.25, .25, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedDipoleModel(-10, 10, -10, 10, 2.5, 3.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_low = FixedDipoleDiscretisation(model_low, 5, 5, 5)
|
||||
|
||||
model_medium = FixedDipoleModel(-10, 10, -10, 10, 3.5, 4.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_medium = FixedDipoleDiscretisation(model_medium, 5, 5, 5)
|
||||
|
||||
model_high = FixedDipoleModel(-10, 10, -10, 10, 4.5, 5.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_high = FixedDipoleDiscretisation(model_high, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,108 +0,0 @@
|
||||
from pdme.model.fixed_dipole_model import FixedDipoleModel, FixedDipoleDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-dipole-middle-all-dots-wide-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_pt():
|
||||
return ((1, 1, 1), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedDipoleModel(-10, 10, -10, 10, 2.5, 3.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_low = FixedDipoleDiscretisation(model_low, 5, 5, 5)
|
||||
|
||||
model_medium = FixedDipoleModel(-10, 10, -10, 10, 3.5, 4.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_medium = FixedDipoleDiscretisation(model_medium, 5, 5, 5)
|
||||
|
||||
model_high = FixedDipoleModel(-10, 10, -10, 10, 4.5, 5.5, numpy.array([1, 1, 1]), 1)
|
||||
discretisation_high = FixedDipoleDiscretisation(model_high, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.fixed_magnitude_model import FixedMagnitudeModel, FixedMagnitudeDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-magnitude-middle-all-dots-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = 6
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedMagnitudeModel(-10, 10, -10, 10, 2.5, 3.5, 6, 1)
|
||||
discretisation_low = FixedMagnitudeDiscretisation(model_low, 6, 6, 5, 5, 5)
|
||||
|
||||
model_medium = FixedMagnitudeModel(-10, 10, -10, 10, 3.5, 4.5, 6, 1)
|
||||
discretisation_medium = FixedMagnitudeDiscretisation(model_medium, 6, 6, 5, 5, 5)
|
||||
|
||||
model_high = FixedMagnitudeModel(-10, 10, -10, 10, 4.5, 5.5, 6, 1)
|
||||
discretisation_high = FixedMagnitudeDiscretisation(model_high, 6, 6, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.fixed_magnitude_model import FixedMagnitudeModel, FixedMagnitudeDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-magnitude-middle-all-dots-narrower-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = 6
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-.25, .25, 0], f), ([-.25, -.25, 0], f), ([.25, -.25, 0], f), ([.25, .25, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedMagnitudeModel(-10, 10, -10, 10, 2.5, 3.5, 6, 1)
|
||||
discretisation_low = FixedMagnitudeDiscretisation(model_low, 6, 6, 5, 5, 5)
|
||||
|
||||
model_medium = FixedMagnitudeModel(-10, 10, -10, 10, 3.5, 4.5, 6, 1)
|
||||
discretisation_medium = FixedMagnitudeDiscretisation(model_medium, 6, 6, 5, 5, 5)
|
||||
|
||||
model_high = FixedMagnitudeModel(-10, 10, -10, 10, 4.5, 5.5, 6, 1)
|
||||
discretisation_high = FixedMagnitudeDiscretisation(model_high, 6, 6, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.fixed_magnitude_model import FixedMagnitudeModel, FixedMagnitudeDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-fixed-magnitude-middle-all-dots-wide-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = 6
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-2, 2, 0], f), ([-2, -2, 0], f), ([2, -2, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = FixedMagnitudeModel(-10, 10, -10, 10, 2.5, 3.5, 6, 1)
|
||||
discretisation_low = FixedMagnitudeDiscretisation(model_low, 6, 6, 5, 5, 5)
|
||||
|
||||
model_medium = FixedMagnitudeModel(-10, 10, -10, 10, 3.5, 4.5, 6, 1)
|
||||
discretisation_medium = FixedMagnitudeDiscretisation(model_medium, 6, 6, 5, 5, 5)
|
||||
|
||||
model_high = FixedMagnitudeModel(-10, 10, -10, 10, 4.5, 5.5, 6, 1)
|
||||
discretisation_high = FixedMagnitudeDiscretisation(model_high, 6, 6, 5, 5, 5)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-middle-all-dots-square.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = random.random()**.3333 * 10
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 101):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,156 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
FILENAME = "z-band-middle-all-dots-narrowsquare-diagnosis1-bad.csv"
|
||||
csv_fields = ["model", "index_px", "index_py", "index_pz", "index_sx", "index_sy", "index_sz", "bounds_px", "bounds_py", "bounds_pz", "bounds_sx", "bounds_sy", "bounds_sz", "actual_dipole_moment", "actual_dipole_position", "actual_dipole_freq", "success", "found_dipole_moment", "found_dipole_position", "found_dipole_frequency"]
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
bad_dipole_moment = (1.4907798255452713, -0.11155216212225307, 8.598957203397196)
|
||||
bad_dipole_position = (-1.8204699606457453, 0.46178206204345074, 3.8691572159777703)
|
||||
bad_dipole_freq = 31
|
||||
|
||||
# good_dipole_moment = (-1.9443892410744588, -6.221537995677158, 5.592388480581515)
|
||||
# good_dipole_position = (1.8087672324818271, -5.012714179961428, 4.171331614506319)
|
||||
# good_dipole_freq = 22
|
||||
#
|
||||
# good_dipoles = OscillatingDipoleArrangement([OscillatingDipole(good_dipole_moment, good_dipole_position, good_dipole_freq)])
|
||||
bad_dipoles = OscillatingDipoleArrangement([OscillatingDipole(bad_dipole_moment, bad_dipole_position, bad_dipole_freq)])
|
||||
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-.25, .25, 0], f), ([-.25, -.25, 0], f), ([.25, -.25, 0], f), ([.25, .25, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
|
||||
bad_dots = bad_dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(bad_dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(bad_dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(bad_dots), discretisation_high.all_indices()))
|
||||
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
|
||||
for idx, result in results_low:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_low.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "low",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": bad_dipole_moment,
|
||||
"actual_dipole_position": bad_dipole_position,
|
||||
"actual_dipole_freq": bad_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
for idx, result in results_medium:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_medium.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "medium",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": bad_dipole_moment,
|
||||
"actual_dipole_position": bad_dipole_position,
|
||||
"actual_dipole_freq": bad_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
for idx, result in results_high:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_high.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "high",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": bad_dipole_moment,
|
||||
"actual_dipole_position": bad_dipole_position,
|
||||
"actual_dipole_freq": bad_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,156 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
FILENAME = "z-band-middle-all-dots-narrowsquare-diagnosis1-good.csv"
|
||||
csv_fields = ["model", "index_px", "index_py", "index_pz", "index_sx", "index_sy", "index_sz", "bounds_px", "bounds_py", "bounds_pz", "bounds_sx", "bounds_sy", "bounds_sz", "actual_dipole_moment", "actual_dipole_position", "actual_dipole_freq", "success", "found_dipole_moment", "found_dipole_position", "found_dipole_frequency"]
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
# bad_dipole_moment = (1.4907798255452713, -0.11155216212225307, 8.598957203397196)
|
||||
# bad_dipole_position = (-1.8204699606457453, 0.46178206204345074, 3.8691572159777703)
|
||||
# bad_dipole_freq = 31
|
||||
|
||||
good_dipole_moment = (-1.9443892410744588, -6.221537995677158, 5.592388480581515)
|
||||
good_dipole_position = (1.8087672324818271, -5.012714179961428, 4.171331614506319)
|
||||
good_dipole_freq = 22
|
||||
|
||||
good_dipoles = OscillatingDipoleArrangement([OscillatingDipole(good_dipole_moment, good_dipole_position, good_dipole_freq)])
|
||||
# bad_dipoles = OscillatingDipoleArrangement([OscillatingDipole(bad_dipole_moment, bad_dipole_position, bad_dipole_freq)])
|
||||
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-.25, .25, 0], f), ([-.25, -.25, 0], f), ([.25, -.25, 0], f), ([.25, .25, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
|
||||
good_dots = good_dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(good_dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(good_dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(good_dots), discretisation_high.all_indices()))
|
||||
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
|
||||
for idx, result in results_low:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_low.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "low",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": good_dipole_moment,
|
||||
"actual_dipole_position": good_dipole_position,
|
||||
"actual_dipole_freq": good_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
for idx, result in results_medium:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_medium.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "medium",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": good_dipole_moment,
|
||||
"actual_dipole_position": good_dipole_position,
|
||||
"actual_dipole_freq": good_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
for idx, result in results_high:
|
||||
pxi, pyi, pzi, sxi, syi, szi = idx
|
||||
|
||||
bounds = discretisation_high.bounds(idx)
|
||||
|
||||
actual_success = result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10
|
||||
|
||||
writer.writerow({
|
||||
"model": "high",
|
||||
"index_px": pxi,
|
||||
"index_py": pyi,
|
||||
"index_pz": pzi,
|
||||
"index_sx": sxi,
|
||||
"index_sy": syi,
|
||||
"index_sz": szi,
|
||||
"bounds_px": (bounds[0][0], bounds[1][0]),
|
||||
"bounds_py": (bounds[0][1], bounds[1][1]),
|
||||
"bounds_pz": (bounds[0][2], bounds[1][2]),
|
||||
"bounds_sx": (bounds[0][3], bounds[1][3]),
|
||||
"bounds_sy": (bounds[0][4], bounds[1][4]),
|
||||
"bounds_sz": (bounds[0][5], bounds[1][5]),
|
||||
"actual_dipole_moment": good_dipole_moment,
|
||||
"actual_dipole_position": good_dipole_position,
|
||||
"actual_dipole_freq": good_dipole_freq,
|
||||
"success": actual_success,
|
||||
"found_dipole_moment": result.normalised_x[0:3] if actual_success else None,
|
||||
"found_dipole_position": result.normalised_x[3:6] if actual_success else None,
|
||||
"found_dipole_frequency": result.normalised_x[6] if actual_success else None
|
||||
})
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,21 +0,0 @@
|
||||
import random
|
||||
import logging
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = random.random()**.3333 * 10
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
def main():
|
||||
logging.info(get_pt())
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-middle-all-dots-narrowsquare.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = random.random()**.3333 * 10
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 501):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-.25, .25, 0], f), ([-.25, -.25, 0], f), ([.25, -.25, 0], f), ([.25, .25, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,117 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
import csv
|
||||
import random
|
||||
|
||||
|
||||
FILENAME = "z-band-middle-all-dots-widesquare-morepts.csv"
|
||||
csv_fields = ["dipole_mom", "dipole_loc", "dipole_freq", "low_success", "low_count", "medium_success", "medium_count", "high_success", "high_count"]
|
||||
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = random.random()**.3333 * 10
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
with open(FILENAME, "a", newline="") as outfile:
|
||||
# csv fields
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writeheader()
|
||||
|
||||
for run in range(1, 501):
|
||||
|
||||
p_pts, s_pts = get_pt()
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole(p_pts, s_pts, run)])
|
||||
logging.info(f"gonna work on point {(p_pts, s_pts, run)}")
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([-2, 2, 0], f), ([-2, -2, 0], f), ([2, -2, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
with open(FILENAME, "a", newline='') as outfile:
|
||||
writer = csv.DictWriter(outfile, fieldnames=csv_fields, dialect='unix')
|
||||
writer.writerow({
|
||||
"dipole_mom": p_pts,
|
||||
"dipole_loc": s_pts,
|
||||
"dipole_freq": run,
|
||||
"low_success": success_low,
|
||||
"high_success": success_high,
|
||||
"medium_success": success_medium,
|
||||
"low_count": count_low,
|
||||
"medium_count": count_medium,
|
||||
"high_count": count_high
|
||||
})
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,73 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((5.389527566844908, 4.997072803674042, -4.762077256152248), (3.2605114165938183, -3.886070609159507, 3.842556916841345), 10)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((6.447362719052435, 4.477945136993354, 0.0339972811954361), (8.136525654773184, -2.566632803268325, 4.386070127058503), 2)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((6.447362719052435, 4.477945136993354, 0.0339972811954361), (8.136525654773184, -2.566632803268325, 4.386070127058503), 2)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((6.447362719052435, 4.477945136993354, 0.0339972811954361), (8.136525654773184, -2.566632803268325, 4.386070127058503), 2)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-9.633241437342807, 7.419566823285379, 6.684101045036112), ( 3.3127514493893315, -0.4771975428520232, 3.5561989108656054), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-9.633241437342807, 7.419566823285379, 6.684101045036112), ( 3.3127514493893315, -0.4771975428520232, 3.5561989108656054), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-9.633241437342807, 7.419566823285379, 6.684101045036112), ( 3.3127514493893315, -0.4771975428520232, 3.5561989108656054), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-6.9343985214646615, -5.204225242506066, -3.8719674540321902), (2.7488105647460674, -0.12340234473323619, 3.6808857954745746), 4)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-6.9343985214646615, -5.204225242506066, -3.8719674540321902), (2.7488105647460674, -0.12340234473323619, 3.6808857954745746), 4)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-6.9343985214646615, -5.204225242506066, -3.8719674540321902), (2.7488105647460674, -0.12340234473323619, 3.6808857954745746), 4)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-7.098352129713321, -4.234283347573212, 5.518928882030382), (1.2260191021210538, -7.338410702914777, 3.83415931272648), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-7.098352129713321, -4.234283347573212, 5.518928882030382), (1.2260191021210538, -7.338410702914777, 3.83415931272648), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-7.098352129713321, -4.234283347573212, 5.518928882030382), (1.2260191021210538, -7.338410702914777, 3.83415931272648), 5)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-0.184772459487974, -5.408149759441951, 7.1877726347903454), (-4.629467853322026, -5.4309905972000045, 3.566486068367097), 6)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-0.184772459487974, -5.408149759441951, 7.1877726347903454), (-4.629467853322026, -5.4309905972000045, 3.566486068367097), 6)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((-0.184772459487974, -5.408149759441951, 7.1877726347903454), (-4.629467853322026, -5.4309905972000045, 3.566486068367097), 6)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,73 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((3.2068945146892367, 2.3350748525972542, -4.184019701963916), (7.442850970594279, 0.2756215916565079, 4.254556180048695), 8)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,73 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0.9602915510740146, -4.026029745743671, -9.049015619049385), (8.414994532717355, -4.618786432010118, 4.124722380672804), 7)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,73 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0.4767791692005509, -1.6250821005525826, 1.098272356895314), (8.619479980282332, -0.43106193700215734, 4.249421193225715), 9)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model_low = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation_low = UnrestrictedDiscretisation(model_low, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_medium = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation_medium = UnrestrictedDiscretisation(model_medium, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
model_high = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation_high = UnrestrictedDiscretisation(model_high, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_low = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_low), itertools.repeat(dots), discretisation_low.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_medium = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_medium), itertools.repeat(dots), discretisation_medium.all_indices()))
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results_high = pool.starmap(get_a_result, zip(itertools.repeat(discretisation_high), itertools.repeat(dots), discretisation_high.all_indices()))
|
||||
|
||||
count_low = 0
|
||||
success_low = 0
|
||||
for idx, result in results_low:
|
||||
count_low += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_low += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_medium = 0
|
||||
success_medium = 0
|
||||
for idx, result in results_medium:
|
||||
count_medium += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_medium += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
count_high = 0
|
||||
success_high = 0
|
||||
for idx, result in results_high:
|
||||
count_high += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success_high += 1
|
||||
else:
|
||||
answer = None
|
||||
|
||||
logging.info(f"Low : Out of {count_low} cells, {success_low} were successful")
|
||||
logging.info(f"Medium: Out of {count_medium} cells, {success_medium} were successful")
|
||||
logging.info(f"High : Out of {count_high} cells, {success_high} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,21 +0,0 @@
|
||||
import random
|
||||
import logging
|
||||
|
||||
def get_uniform_sphere():
|
||||
r = random.random()**.3333 * 10
|
||||
a = random.uniform(-10, 10)
|
||||
b = random.uniform(-10, 10)
|
||||
c = random.uniform(-10, 10)
|
||||
f = (a**2 + b**2 + c**2)**.5
|
||||
return (a * r / f, b * r / f, c * r / f)
|
||||
|
||||
|
||||
def get_pt():
|
||||
return (get_uniform_sphere(), (random.uniform(-10, 10), random.uniform(-10, 10), random.uniform(3.5, 4.5)))
|
||||
|
||||
def main():
|
||||
logging.info(get_pt())
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 4.5, 5.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 2.5, 3.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
@ -1,41 +0,0 @@
|
||||
from pdme.model.unrestricted_model import UnrestrictedModel, UnrestrictedDiscretisation
|
||||
from pdme.measurement import OscillatingDipole, OscillatingDipoleArrangement
|
||||
import itertools
|
||||
import logging
|
||||
import multiprocessing
|
||||
import numpy
|
||||
|
||||
|
||||
def get_a_result(discretisation, dots, index):
|
||||
return (index, discretisation.solve_for_index(dots, index))
|
||||
|
||||
def main():
|
||||
dipoles = OscillatingDipoleArrangement([OscillatingDipole((0, 0, 2), (1, 2, 4), 1)])
|
||||
dot_inputs = list(itertools.chain.from_iterable(
|
||||
(([1, 2, 0], f), ([1, 1, 0], f), ([2, 1, 0], f), ([2, 2, 0], f)) for f in numpy.arange(1, 10, 2)
|
||||
))
|
||||
dots = dipoles.get_dot_measurements(dot_inputs)
|
||||
|
||||
model = UnrestrictedModel(-10, 10, -10, 10, 3.5, 4.5, 1)
|
||||
discretisation = UnrestrictedDiscretisation(model, 6, 6, 3, 5, 5, 5, 10)
|
||||
|
||||
with multiprocessing.Pool(multiprocessing.cpu_count()-1 or 1) as pool:
|
||||
results = pool.starmap(get_a_result, zip(itertools.repeat(discretisation), itertools.repeat(dots), discretisation.all_indices()))
|
||||
|
||||
count = 0
|
||||
success = 0
|
||||
for idx, result in results:
|
||||
count += 1
|
||||
if result.success and result.cost <= 1e-10 and numpy.linalg.norm(result.x[0:3]) < 10:
|
||||
answer = result.normalised_x
|
||||
success += 1
|
||||
else:
|
||||
answer = None
|
||||
logging.debug(f"{idx} : {discretisation.bounds(idx)}")
|
||||
logging.debug(f"{idx} : {answer}\n")
|
||||
logging.info(len(results))
|
||||
logging.info(f"Out of {count} cells, {success} were successful")
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
main()
|
334
temp.csv
334
temp.csv
@ -1,334 +0,0 @@
|
||||
"dipole_mom","dipole_loc","dipole_freq","low_success","low_count","medium_success","medium_count","high_success","high_count"
|
||||
"(-6.16839537956168, -6.18034685302644, 0.45065887606157184)","(-3.73879622353952, 3.371499240013044, 4.1362326261982645)","1","154","13500","174","13500","141","13500"
|
||||
"(6.174667043556438, 6.336202980594002, 2.4958220347329623)","(-8.148859083510967, 3.6968131093195353, 3.7702726234713078)","2","719","13500","747","13500","724","13500"
|
||||
"(3.608956372981022, -2.0951988991900077, -0.29421992676982156)","(3.573650082677384, -9.368498412102449, 4.46864529948172)","3","600","13500","674","13500","792","13500"
|
||||
"(5.082322693160297, -3.7982625668861587, -5.529377336641543)","(-2.2936623215085072, -6.239557703119452, 3.9482460970876017)","4","776","13500","611","13500","458","13500"
|
||||
"(8.409995998700815, -3.2224394558538725, -0.4327015578525425)","(-0.081531901811287, -0.5041132949873877, 4.121705478826287)","5","68","13500","48","13500","0","13500"
|
||||
"(3.2487256809913414, 2.0956177477119664, 3.055911236386847)","(-8.774289727975598, -3.95159042580691, 4.274447404072161)","6","682","13500","794","13500","1006","13500"
|
||||
"(1.6803517653056426, 5.004816849346787, -2.5453624256732663)","(0.24019628199513754, 9.352393431383653, 3.5411114005007343)","7","488","13500","569","13500","538","13500"
|
||||
"(-5.3631643483435925, -7.392714848183142, -0.35345841926220234)","(-8.55126342036379, -5.277948483201045, 3.544409893485965)","8","386","13500","349","13500","384","13500"
|
||||
"(-2.088041340867869, -1.417158200235787, -8.611496316364478)","(-6.230585021981636, -8.161150785514625, 4.229834430803789)","9","970","13500","1058","13500","1068","13500"
|
||||
"(1.9621473273796497, 2.5349620919141334, 3.341103068928371)","(-0.9134806790737926, -4.3291668398816485, 4.392061300761365)","10","548","13500","530","13500","316","13500"
|
||||
"(-1.6322513926669313, -1.0847514333253572, -9.288258270896861)","(-8.448895118069297, 5.732398768239946, 4.213759032569264)","11","842","13500","881","13500","902","13500"
|
||||
"(3.9481297719943638, 4.507810776715989, -5.709918951334119)","(-4.1315207286021245, 9.170651848195138, 4.441047450511733)","12","7692","13500","7616","13500","7741","13500"
|
||||
"(6.369749097200515, -6.978053871587953, 0.4955446250532843)","(-6.239966859100619, 8.423719070951016, 4.2820375417276635)","13","336","13500","416","13500","496","13500"
|
||||
"(3.196731644049891, 4.298110174247948, 6.115139818740193)","(8.755512984757075, 3.29622966664574, 3.809217881300216)","14","328","13500","305","13500","272","13500"
|
||||
"(-1.7761249032812005, 6.94680873682224, -0.8585495821127017)","(-3.9472654101927613, 1.3657338898850675, 3.648963992377148)","15","252","13500","206","13500","88","13500"
|
||||
"(-1.951230216244639, -9.1812215776026, -2.6482034312090104)","(9.26053760101319, -1.7925555221277616, 4.446180364967014)","16","808","13500","804","13500","720","13500"
|
||||
"(-7.373793882449, 4.641080906868707, -4.065664647502973)","(1.359292030451364, 2.6076146812770773, 4.077208092443877)","17","230","13500","125","13500","62","13500"
|
||||
"(4.99666337182169, -4.24706596552135, -6.48086516774026)","(-7.79046143844579, -9.238914044181318, 4.123324076664045)","18","932","13500","948","13500","1074","13500"
|
||||
"(1.3118180219979787, 7.882624311829391, -1.4113523986813743)","(-7.453090521787063, -2.6911428138874083, 3.5764874973745453)","19","358","13500","342","13500","330","13500"
|
||||
"(-3.9156627126021823, 3.652991774629386, -1.9620621102293458)","(-6.722240407200426, -8.64966445122025, 4.4022558010603845)","20","7257","13500","7359","13500","7280","13500"
|
||||
"(-2.5778287153467607, -4.3502613369287015, 5.854048768560913)","(-7.359360429044108, 1.3532276629995366, 4.346230679700137)","21","496","13500","534","13500","400","13500"
|
||||
"(-5.206369872326459, -6.862294652251791, 1.8329467929417802)","(8.158983191490407, -5.797619127417697, 3.5768271334601334)","22","862","13500","980","13500","1060","13500"
|
||||
"(-5.0117372804933815, -7.0423030129922015, -4.725774627569535)","(-1.9099901351358142, 4.07062194106569, 3.7991304425931878)","23","164","13500","20","13500","0","13500"
|
||||
"(-0.07972750515058172, -2.1507969823346125, -2.226619760098137)","(9.1376884914155, -4.709563135970127, 3.735049549357491)","24","7232","13500","7362","13500","7171","13500"
|
||||
"(-5.144365593723058, -3.9475841795629956, 5.748537236527811)","(4.492936798487648, 5.405570485218924, 4.158404586642079)","25","594","13500","642","13500","718","13500"
|
||||
"(-2.8546031170069313, 0.5833065875776039, -3.095171574758373)","(-5.5292166949492945, 7.71333968827587, 4.133669398747843)","26","6994","13500","7097","13500","7255","13500"
|
||||
"(5.81158461851278, -5.278637454162237, -0.4699498074220259)","(0.27490535385172166, -2.94896479221181, 3.8067628826265483)","27","118","13500","107","13500","18","13500"
|
||||
"(6.193700828136645, -7.345996428812407, -1.4498287440254478)","(-7.3197391451383975, 4.222266233112602, 4.096141254209892)","28","259","13500","217","13500","218","13500"
|
||||
"(-0.8468106221680349, 2.731941481584685, -5.616223146422884)","(-8.692467537573778, -9.835520229056538, 4.115164996525969)","29","861","13500","952","13500","994","13500"
|
||||
"(-2.0585522204922877, -3.166022041593507, -3.4697012285097357)","(5.348765264656576, 3.5458959074419543, 4.026964642746904)","30","410","13500","428","13500","248","13500"
|
||||
"(4.812008642325896, -2.368003672186463, -1.8370090427451913)","(6.0236705899332605, -9.488564431728559, 3.976335121962416)","31","754","13500","850","13500","1036","13500"
|
||||
"(1.6461391837144563, -2.841645878882412, 0.5209585611647601)","(5.93514945457345, 4.192156575049314, 4.0328242152473575)","32","7727","13500","7669","13500","7797","13500"
|
||||
"(-6.562873450942225, 6.740461010180645, -1.341338985974318)","(-4.715299036869887, -8.699310447605367, 3.829932403898407)","33","772","13500","866","13500","832","13500"
|
||||
"(-2.4775967223805586, -3.616813244601252, 3.589572998363035)","(2.389311028750287, -2.782794574475247, 4.166681852749758)","34","264","13500","169","13500","60","13500"
|
||||
"(6.8400907210185045, 4.865544157218578, -4.543209469780238)","(-6.4600132858744, 0.36685131780962266, 4.367233343362649)","35","162","13500","151","13500","52","13500"
|
||||
"(-5.49420233352331, -5.950327573070705, -2.533513958811733)","(0.6167471675436804, 0.3122728573202096, 4.0455446719747625)","36","86","13500","44","13500","46","13500"
|
||||
"(-3.0779321139474503, 0.598776276356238, 3.2044621788916294)","(2.884969811733722, 8.942590952868436, 3.6512019638735502)","37","6924","13500","7044","13500","7199","13500"
|
||||
"(6.817310254485522, 3.2164565226087194, -2.6851546079932573)","(2.9499823006298413, -5.1348163513117395, 4.033771088202341)","38","667","13500","586","13500","494","13500"
|
||||
"(-4.021089956271416, -0.036385983191528595, 5.983689263284422)","(-5.111207386636909, 2.0241367480477397, 3.5376057326904884)","39","183","13500","82","13500","40","13500"
|
||||
"(6.27694957435399, -4.8450251924621925, -2.8211883138666773)","(2.6354088333013603, -8.303830407416768, 4.2040812393302645)","40","492","13500","636","13500","636","13500"
|
||||
"(-2.1713050868537924, 3.479434265608742, -3.4011767764243266)","(-2.085538400893703, 9.72883978457127, 3.7189248267994266)","41","3537","13500","3951","13500","4237","13500"
|
||||
"(9.284568375936827, -0.6249050005798358, -3.4554742135312515)","(4.190583166123627, -5.264495618539502, 4.330133260273236)","42","642","13500","680","13500","568","13500"
|
||||
"(-3.4561911324936974, 8.803435409087774, -3.0159146597384203)","(9.757401506490893, -6.724744448930706, 3.530541147115256)","43","478","13500","544","13500","505","13500"
|
||||
"(-3.13701054327241, 5.460473277529024, 0.5614734942843335)","(1.1058416777136042, -1.1413164937225329, 4.0895307217804655)","44","154","13500","86","13500","32","13500"
|
||||
"(-1.3174051820930006, -1.6114801652920774, 2.7961390015971985)","(7.285423259682375, -9.952254874642488, 3.683929474011751)","45","7098","13500","7205","13500","7104","13500"
|
||||
"(-1.7655276732001988, 1.18719782051, -2.518611747842831)","(9.78284894165207, -5.663255080032272, 4.056348386272607)","46","816","13500","890","13500","960","13500"
|
||||
"(1.0919733029299443, -5.724243920421176, -7.088990662247247)","(5.562311230771858, 2.5282376760751006, 4.247232513859933)","47","296","13500","245","13500","122","13500"
|
||||
"(0.5194212575207041, -1.463526786878611, -7.357970218727399)","(9.20607059288566, -3.2785142400442098, 4.471086963443776)","48","917","13500","958","13500","988","13500"
|
||||
"(-4.962706785155434, 3.9403096504049087, 0.003743892391732344)","(-3.3722668908550313, -2.3615543293545382, 3.93581059253161)","49","374","13500","379","13500","297","13500"
|
||||
"(1.4963199271523089, 3.2485115250363537, -2.9779288846083847)","(-9.15846583043432, 0.024675242971561318, 4.206343827028576)","50","840","13500","888","13500","940","13500"
|
||||
"(8.102516716508365, 1.1651658547979684, 1.2668471211616792)","(-3.7330945554224426, -9.46442129767653, 3.6100795184952794)","51","806","13500","878","13500","964","13500"
|
||||
"(4.7730256321204285, -4.60919321112888, -4.890263458301365)","(4.270487904137967, 4.398824030761798, 4.191047548622201)","52","462","13500","329","13500","262","13500"
|
||||
"(-4.491434560114916, -0.34825427521823216, -4.314267386986976)","(-8.617454340229152, 2.745781718760318, 3.963810649309446)","53","7540","13500","7654","13500","7724","13500"
|
||||
"(1.8044939743344608, -0.6894868505672775, -2.3175568910690307)","(-2.844961682723241, -6.136096395690704, 3.6587524888935086)","54","870","13500","839","13500","961","13500"
|
||||
"(-1.722856156127666, -8.53407339445032, 1.2673559203876146)","(0.5650722562581496, -9.448459161528246, 4.1146168706626085)","55","395","13500","378","13500","352","13500"
|
||||
"(-2.872897933253114, 2.662780703894132, 1.3815375272780426)","(6.965114184327298, -9.479905536150504, 3.5024319403819977)","56","5022","13500","5228","13500","5522","13500"
|
||||
"(4.961408198950212, 5.892224502113003, -2.756339522018841)","(-5.762959837451234, -1.645141339732481, 4.258162443059694)","57","202","13500","179","13500","154","13500"
|
||||
"(3.9190180812898436, 5.756567924027287, 2.662298108590971)","(6.432946787378388, -6.294916797640719, 3.6191399433325833)","58","7994","13500","7946","13500","7935","13500"
|
||||
"(-3.8466611324636957, 1.4309328393434502, -6.175862210415548)","(-7.016881145654239, 2.852729879219476, 4.494639122267188)","59","7342","13500","7326","13500","7422","13500"
|
||||
"(0.11186440073433994, 7.180237594810335, -6.3051095088848275)","(9.408054184045568, 1.2897848857038081, 4.33733515125617)","60","851","13500","920","13500","933","13500"
|
||||
"(-8.147341139048859, -0.5616387389178971, 3.4634006477660435)","(-2.155971018977361, 2.466361547405791, 3.661586254283502)","61","82","13500","32","13500","6","13500"
|
||||
"(4.504825777771923, 4.342414798289936, 4.422358492735073)","(8.705750824699695, 2.20960049248815, 4.455675768748234)","62","338","13500","326","13500","338","13500"
|
||||
"(5.98509708335786, -2.941130387233096, 3.6107518737927324)","(-1.6181229860874584, -9.511427113228256, 3.8100859026859237)","63","762","13500","848","13500","914","13500"
|
||||
"(2.970573043619998, 8.111482493217547, 0.7997978360716533)","(9.561107172035946, -3.1986272195530923, 3.8861418650729815)","64","7292","13500","7310","13500","7332","13500"
|
||||
"(-5.743042093983852, -4.062859201638838, -6.6166903630132845)","(-4.729213791288512, 3.612948973708569, 4.43417049942597)","65","533","13500","434","13500","293","13500"
|
||||
"(9.141606089090251, -0.6267754516637671, 0.5690797153683173)","(6.3395165320932065, -0.6219172778834405, 4.382163366000168)","66","266","13500","175","13500","140","13500"
|
||||
"(-3.041385270490991, -6.331114292452659, -4.5718680364050845)","(6.55742329074036, 8.675141109643484, 3.5897485612162314)","67","678","13500","701","13500","624","13500"
|
||||
"(5.644539025942162, 2.547634103825204, 3.5687834389563107)","(8.959573032986103, 0.1499889519952795, 4.0634283101385895)","68","372","13500","440","13500","410","13500"
|
||||
"(6.03337783576765, -4.610648514788624, -4.554616103230079)","(-7.024730046400114, -3.3087563249793455, 4.075891736949058)","69","732","13500","577","13500","447","13500"
|
||||
"(0.6302683573389296, 2.1127998362650975, 9.21014850283742)","(5.621709855128405, 0.11782441441767588, 4.257532606948004)","70","190","13500","132","13500","60","13500"
|
||||
"(-6.528661516244151, -5.100348875256412, 4.479149993654501)","(-7.191720112559279, -5.374217611312808, 4.444583707721159)","71","478","13500","382","13500","376","13500"
|
||||
"(3.152035400955325, 5.669539376964033, -6.4917691173149095)","(-9.758400537394163, 4.737267583766966, 4.162401679758397)","72","871","13500","953","13500","1012","13500"
|
||||
"(-6.357920048515486, -5.136931250419799, 5.03071179227527)","(7.485302688493533, 3.7149382387529037, 4.222287460137179)","73","496","13500","565","13500","759","13500"
|
||||
"(-2.5013159423316518, -2.2595060942354723, 1.3182117007816685)","(-5.6938559512371985, 2.115097486355932, 4.287916014601678)","74","798","13500","818","13500","735","13500"
|
||||
"(-3.643546563144299, -0.294751758173318, -1.6028943758171061)","(8.350392970061094, 4.4019663509947335, 3.814357667019697)","75","772","13500","860","13500","941","13500"
|
||||
"(-7.193529632890411, -3.6605715041552065, 4.788537984910783)","(-7.735775022726868, 0.3128395097308623, 4.280243244114823)","76","383","13500","316","13500","284","13500"
|
||||
"(-1.7905031119297112, -6.095577862756382, 5.654517951933622)","(-9.320733509956774, -9.333086658145985, 4.156067928514263)","77","748","13500","814","13500","970","13500"
|
||||
"(-0.28524685575776343, 7.280224841477887, -5.9646668281522786)","(2.7769339617978837, -3.0432421078300287, 4.031763929955411)","78","96","13500","38","13500","0","13500"
|
||||
"(1.2844218620659693, 5.487574123299404, 3.8778283531959032)","(-0.5018568265290551, 7.391877406290462, 4.0084340484527585)","79","376","13500","356","13500","302","13500"
|
||||
"(5.681853645098174, -4.759785445878397, 2.4261518844078673)","(1.084802872054702, -4.626906761144836, 4.359582224876295)","80","276","13500","177","13500","220","13500"
|
||||
"(0.92323385474089, 1.9026891663899854, 2.119049640511452)","(2.9397096354655954, 3.748272614920685, 4.457937412570196)","81","630","13500","694","13500","572","13500"
|
||||
"(-4.415455221140206, 2.2428175589358044, -7.715624227573728)","(3.263367677651356, -1.8905175302111346, 3.9804045483280226)","82","28","13500","32","13500","2","13500"
|
||||
"(-8.220735534427307, -3.843884719032048, 3.054999379085758)","(1.4894309953807223, 4.1410257071641325, 3.585275538393951)","83","292","13500","240","13500","122","13500"
|
||||
"(-9.704663448286606, -1.8877811524861352, -0.044528018865547435)","(-3.904235403156311, -1.2918663483177433, 4.430571210618315)","84","259","13500","187","13500","178","13500"
|
||||
"(-7.842122574039736, -3.3862153067430825, -2.3560867723825405)","(-8.564030513629685, 1.465163892954637, 3.594744814643586)","85","672","13500","696","13500","622","13500"
|
||||
"(2.5208813464775366, -3.7123757034192555, -3.3772702825771397)","(9.088919547619508, -3.3972490934769244, 4.192066016811076)","86","7439","13500","7589","13500","7491","13500"
|
||||
"(-6.79743070046568, -6.35410938208514, -0.11932108439521848)","(-1.4973699639025781, 7.2092090816308065, 3.7252236437105006)","87","719","13500","599","13500","486","13500"
|
||||
"(-4.613707764736524, 4.979906112867835, 2.37826259284373)","(7.814903285482664, 7.064579631045081, 3.65810160511178)","88","7209","13500","7286","13500","7320","13500"
|
||||
"(2.714739257564787, -5.487811125577754, 0.6948429574598884)","(-6.991498550635729, -2.991464710297043, 3.6113555507295994)","89","7511","13500","7476","13500","7454","13500"
|
||||
"(-1.341458265422907, 4.828142824155162, -5.844219054734552)","(-1.8303179522002555, -8.7735159244394, 3.7232401571674196)","90","564","13500","618","13500","608","13500"
|
||||
"(-4.175624280014316, -8.333703688059703, -1.5380954415611334)","(3.845195099090864, -1.86678103080866, 3.5901101711116783)","91","218","13500","145","13500","68","13500"
|
||||
"(5.959314385202411, 5.127348568789275, 6.024446452071635)","(-0.3322590801612879, -7.9521904304643805, 3.811455249570857)","92","855","13500","923","13500","1019","13500"
|
||||
"(-3.762422685062596, 3.846739999396946, 4.8918472702040745)","(-0.07956774462169491, 1.6804679023705678, 4.289244398128128)","93","100","13500","92","13500","68","13500"
|
||||
"(0.9632953503506887, 6.160322416332956, 2.054864443301467)","(-6.726409845913491, -5.550510442632963, 4.420565812383116)","94","792","13500","780","13500","888","13500"
|
||||
"(5.49080420386639, -4.619950743363047, -5.100612853359646)","(-9.172715602106287, -7.371960078468112, 4.360152118906595)","95","7174","13500","7141","13500","7281","13500"
|
||||
"(6.078676024081242, -0.13062547927656654, -5.719342506898833)","(-2.78883912516706, -3.385086062164275, 3.613291592485341)","96","144","13500","64","13500","6","13500"
|
||||
"(-3.1016589305973263, 2.098268244192234, -4.6266303158714335)","(9.991269561306666, -2.0876551162738455, 3.78298957074165)","97","812","13500","888","13500","1016","13500"
|
||||
"(-3.573269219952555, 3.101704435087233, -5.2309511262526875)","(-6.244341894848871, 9.01599884658306, 3.864194114404788)","98","7680","13500","7652","13500","7664","13500"
|
||||
"(0.3774857027832421, 5.081334879664132, -6.382449112135572)","(4.960782320362984, 3.3758281091518114, 3.8985762767781256)","99","597","13500","519","13500","514","13500"
|
||||
"(4.236318622767721, -4.66715908614608, -4.594791697756503)","(-1.072758690814517, 2.72282208367092, 4.422497590060249)","100","182","13500","89","13500","90","13500"
|
||||
"(-5.746985155441868, 6.794109501909199, 3.7102545589118594)","(4.604210931453148, -3.0411137915822195, 4.2385186007701146)","101","358","13500","491","13500","576","13500"
|
||||
"(-4.810399011959711, 2.9722288168807967, 0.5280584548437753)","(9.966968726241184, 4.716300765252399, 3.9739055054010235)","102","7298","13500","7234","13500","7381","13500"
|
||||
"(7.6446907923464025, -5.658954960088162, 2.0721137334819546)","(7.88892749384231, 4.6353336580677755, 4.12804628934988)","103","678","13500","785","13500","784","13500"
|
||||
"(-4.898799632658858, 4.702334884449768, -4.9760927547137435)","(1.2543260583773748, 1.2200140442633902, 4.161573626806362)","104","134","13500","119","13500","52","13500"
|
||||
"(-5.576542745371556, 0.7597994723577076, 7.916527394216577)","(-8.980354536683034, 0.9089042793217157, 4.493837854153166)","105","358","13500","386","13500","364","13500"
|
||||
"(4.928904586452334, -3.203281652173655, -5.691829017550639)","(-1.6412552623666539, 7.472166470911333, 3.789188489136713)","106","360","13500","376","13500","344","13500"
|
||||
"(-5.592091097414037, 1.4578133905346515, 3.80257731602232)","(2.950343107089836, 8.218834873771932, 3.8603496616104795)","107","6864","13500","6937","13500","7158","13500"
|
||||
"(-4.027367853338311, 1.8672134848284523, -1.4444682280861658)","(-3.9537036187064505, -2.374264671997439, 4.331520375295981)","108","7564","13500","7541","13500","7567","13500"
|
||||
"(-7.606052064086022, 3.196215312274696, -4.468941447450977)","(-1.9161254204291485, -1.121514212278008, 3.8217138967570614)","109","175","13500","117","13500","94","13500"
|
||||
"(6.5085300786765785, 5.863861055832227, -3.771925681535417)","(9.143998589767335, 0.17408632430909243, 3.529395737918477)","110","736","13500","790","13500","927","13500"
|
||||
"(3.3406387985406947, 3.9182375443362285, 1.4575518398787712)","(8.334229440084332, -5.2713592094676525, 4.11051243567915)","111","7072","13500","7217","13500","7318","13500"
|
||||
"(3.8887705570117035, 3.872651150828253, 4.186808020002902)","(-7.501953228641744, -9.698579831310884, 3.593065714749732)","112","7553","13500","7649","13500","7721","13500"
|
||||
"(-6.158392478536139, 0.5447375012464558, -5.121747886587222)","(6.1154951175290435, 4.318533968498235, 3.516365315546088)","113","552","13500","502","13500","406","13500"
|
||||
"(-1.4956379702754927, 2.999304152789293, 4.336374087253659)","(1.8363777665776286, -7.751936591921089, 4.298004645296327)","114","7217","13500","7269","13500","7217","13500"
|
||||
"(-4.228183646362735, 1.0912342446033825, 3.5526949163644)","(9.89010269500951, -6.034798853914463, 4.227746227739228)","115","7544","13500","7658","13500","7728","13500"
|
||||
"(-2.022005156926926, 0.9146259595332331, 3.8934616436005975)","(-5.168603165190666, -0.15594523511392744, 3.917668671354011)","116","486","13500","476","13500","428","13500"
|
||||
"(6.068631359245405, -0.6104604963114044, 4.22682044674758)","(0.05130680957629963, 8.550985957104729, 4.063452760643039)","117","4050","13500","4255","13500","4608","13500"
|
||||
"(-4.39197990186564, -5.924572147603168, -2.919213655855935)","(-0.0037574704454144126, -7.925279332681723, 3.5621485203460983)","118","666","13500","784","13500","877","13500"
|
||||
"(-5.7256951668074825, 5.800169353813454, 1.9422098767266298)","(-9.03232109884778, -2.09431751897875, 4.133087202555354)","119","724","13500","824","13500","886","13500"
|
||||
"(0.6054903039308722, 7.409623136318561, -1.5628844584915704)","(-0.6083553788598444, -9.122705167055564, 4.441064659062688)","120","494","13500","574","13500","620","13500"
|
||||
"(7.314921684122868, -2.2600419579037085, 6.044226841537821)","(-8.847506152105467, -7.1457265894871185, 3.6799903207952918)","121","7256","13500","7315","13500","7293","13500"
|
||||
"(-3.0361184384371116, -6.601686611169108, -2.827211539454324)","(-4.064420205997415, -5.922440224950625, 4.1378126856573445)","122","450","13500","643","13500","850","13500"
|
||||
"(-6.93271321030373, 2.9099840761809177, 2.1572675027711847)","(3.2790083481102172, 3.9413176303151065, 3.7900632360196327)","123","696","13500","726","13500","794","13500"
|
||||
"(4.198603841843743, -7.063403923385852, 5.325378053492108)","(3.2305929312729535, 3.1507929400091506, 3.583696632877772)","124","274","13500","207","13500","138","13500"
|
||||
"(1.812446005083017, 2.674915702283031, -9.41500112777269)","(4.74281930392606, 4.433872746349966, 4.261470779712429)","125","586","13500","500","13500","468","13500"
|
||||
"(1.3611217207495983, 5.345909306613655, 0.25353579695242334)","(6.661325621336147, -7.377182983697377, 3.897469903024681)","126","7330","13500","7288","13500","7314","13500"
|
||||
"(-2.738036312099483, -4.454018857272212, -5.969211017877605)","(3.862699799027986, -5.037284746382067, 3.8700042117568607)","127","610","13500","693","13500","724","13500"
|
||||
"(-4.351006266288305, -3.714320606076853, -5.150887630584172)","(-0.8157830850905086, -2.407450368973773, 3.946779405979701)","128","151","13500","119","13500","62","13500"
|
||||
"(4.9765683272536645, -0.8118995028202182, -4.985196679930244)","(1.8846284464741778, 2.6473655580840862, 3.938926608206602)","129","216","13500","123","13500","76","13500"
|
||||
"(3.358808204998972, -3.691059409766847, 2.816311226806332)","(9.870581703901212, 1.4744865565658145, 4.460111226245932)","130","775","13500","870","13500","918","13500"
|
||||
"(0.1987827734972164, -0.408696961409285, 1.9460525604314813)","(-5.288069744602064, -7.737243888938437, 4.48359407984586)","131","7198","13500","7122","13500","7170","13500"
|
||||
"(-1.7205116004154621, -3.599563468593553, -4.145526221043457)","(4.651759627537672, -1.9774951127306721, 4.398291081815237)","132","659","13500","521","13500","468","13500"
|
||||
"(-0.3576510264082686, -2.800307216058359, -2.020083770332096)","(-2.9705597323907433, -6.024768170299913, 4.298459879165384)","133","7432","13500","7584","13500","7541","13500"
|
||||
"(-2.8341411067727016, 5.513474505542067, 1.3693085942565613)","(3.043695797126089, -5.818027387792249, 3.7707489385111628)","134","484","13500","656","13500","634","13500"
|
||||
"(-6.478423980971377, -6.925793342508837, -1.2901948798264413)","(-4.194432564923893, 7.977388244283976, 3.7889076592602144)","135","834","13500","861","13500","942","13500"
|
||||
"(-1.0940206493436557, -5.384800894343178, 4.951752218350183)","(-5.909613174774801, 9.315732947021363, 3.8696295166689256)","136","7337","13500","7397","13500","7278","13500"
|
||||
"(5.073451371930732, -6.476243988110691, 4.117738607442446)","(-1.423925494689918, -9.828084210751417, 4.285234205160479)","137","600","13500","736","13500","842","13500"
|
||||
"(1.9159813069625986, -5.684870016154675, 5.579402609578914)","(-3.7018488476017524, 0.5686937637409564, 3.9624805995444334)","138","220","13500","142","13500","124","13500"
|
||||
"(-4.524388714683123, 4.610348202069107, -4.909173847684985)","(-2.2033422195558288, 1.766528703035764, 3.7267294200274375)","139","125","13500","150","13500","20","13500"
|
||||
"(2.488951770895608, -5.531994075693279, 4.748904113975928)","(-8.859705011156054, -1.168052759937094, 3.803492710819103)","140","7117","13500","7198","13500","7312","13500"
|
||||
"(-3.8777378825601434, 4.4528913199729905, 3.814401259230706)","(5.116657924926024, 8.46939459869634, 4.203661536720321)","141","828","13500","918","13500","952","13500"
|
||||
"(-6.325109519770556, -2.8725400927144062, 6.954419613078052)","(-1.0007918254593946, 0.3398352620843177, 3.911842826551915)","142","58","13500","22","13500","0","13500"
|
||||
"(-4.962747386254679, -0.11067229921078263, -3.270142586306215)","(-5.2727506252829315, -9.174170414693961, 4.097027253596108)","143","7018","13500","7041","13500","7006","13500"
|
||||
"(-8.03029279253685, 1.8862097709040584, 4.32178282388661)","(2.8228448679369045, 3.030037186264, 4.067642883811359)","144","606","13500","576","13500","520","13500"
|
||||
"(-3.3333056943995634, 1.2825513661470476, -5.555288771896324)","(-3.275663862523002, 4.182119467156927, 4.112665677271387)","145","520","13500","515","13500","527","13500"
|
||||
"(2.707462954054215, -4.884925750402275, 0.5177661457483426)","(7.393542906846548, -6.327277505078335, 4.137565727206889)","146","792","13500","885","13500","988","13500"
|
||||
"(-7.646950990475358, 4.987026261271332, -3.6135883326615335)","(-9.530208748195596, 7.446034827625766, 4.392239451064593)","147","732","13500","818","13500","1008","13500"
|
||||
"(5.930247737680775, -3.981602009820487, 2.6108680960621005)","(-3.91636034373329, 2.731654827212111, 3.969591162998382)","148","511","13500","629","13500","812","13500"
|
||||
"(-7.553289022756074, 0.8456792963767286, 4.672174523971438)","(5.835114609373367, -2.7846078300432664, 4.491136949687943)","149","677","13500","732","13500","914","13500"
|
||||
"(3.9122541568477813, 1.3334565767327755, -6.8500902356343)","(-7.5311961266945175, 3.050785200349022, 3.6548038063320423)","150","626","13500","650","13500","570","13500"
|
||||
"(0.7572799536576529, -9.348840793926264, -0.4864678927988897)","(0.3892989898430166, 8.25630300681346, 4.017486456767696)","151","336","13500","406","13500","394","13500"
|
||||
"(1.7763763519640843, 8.415446365665101, -4.787251529217243)","(8.202980335232919, 8.45815543871494, 4.331542672453596)","152","7469","13500","7559","13500","7621","13500"
|
||||
"(-0.048477610493141816, -3.03641117554586, 2.583428364672299)","(8.715363650029254, 5.841426966238783, 4.080094454120243)","153","7046","13500","7105","13500","7216","13500"
|
||||
"(-3.6423915202423656, 2.288438231938079, -1.2533491138786979)","(8.591624202565729, 5.485372443517392, 3.8001526750413577)","154","7182","13500","7176","13500","7227","13500"
|
||||
"(-2.2576457457018106, 3.1514469999063435, -8.141612892606489)","(-8.071045916219584, 3.149342840124918, 4.44993037231236)","155","6733","13500","6984","13500","7364","13500"
|
||||
"(1.000891769871133, -1.6754849009050048, 4.848165911955951)","(6.534749375984195, 4.695823026419996, 3.6392582512218397)","156","844","13500","911","13500","983","13500"
|
||||
"(-4.688810501206424, -6.256162889776233, 0.35201144737044976)","(6.243739360497024, 7.380910621356453, 3.749189124286371)","157","600","13500","730","13500","828","13500"
|
||||
"(1.0533136287737117, 7.352392254350535, 5.6377492571199035)","(-5.434421923212978, 3.3132774890780343, 4.058314482602519)","158","569","13500","524","13500","468","13500"
|
||||
"(3.677043735939675, -1.288326808652064, 6.652685720829809)","(4.386961774936605, -0.5854014141790209, 3.746992214247249)","159","224","13500","99","13500","34","13500"
|
||||
"(-4.995542952824577, -0.06861475437761225, 1.9779905019546573)","(-0.3653602633573705, -7.381745997601936, 4.321454057421624)","160","6903","13500","6998","13500","7192","13500"
|
||||
"(6.984824462392073, -2.6834971997135586, 2.4690657401247664)","(1.5058286777044998, 4.669417560418566, 4.187415381230282)","161","669","13500","614","13500","639","13500"
|
||||
"(-6.6486487722596515, 0.6124909424125512, -1.898887314202754)","(9.591553969856282, -5.266294550554839, 4.398879103882635)","162","780","13500","880","13500","1008","13500"
|
||||
"(-5.991737750288909, -6.456223704839895, 3.6057193064833033)","(-8.345458307533908, 1.0762402236130892, 3.6248784477392677)","163","624","13500","630","13500","592","13500"
|
||||
"(1.3946140484081275, 8.459761421973713, -3.933810121313556)","(-7.264949656958848, 9.854933553997054, 3.7959524200135926)","164","7468","13500","7446","13500","7483","13500"
|
||||
"(6.89479963142868, 6.913696329710681, 0.1719011277476893)","(-2.2762268038358897, -4.164994153887676, 4.3652080113027)","165","276","13500","359","13500","303","13500"
|
||||
"(7.960273016016024, 0.7787697506512764, -1.6077424327636327)","(-0.5605295975201585, 2.0945428562433506, 3.792816596289648)","166","438","13500","352","13500","201","13500"
|
||||
"(-3.074019302735935, 1.7882833253558206, 9.228105938262908)","(6.1427725529963695, -7.330311797475321, 3.849169863574554)","167","6906","13500","7112","13500","7294","13500"
|
||||
"(6.120006486538424, 4.213028701416303, 4.126849944812192)","(6.640244833054766, -3.922328134087552, 3.8998298930817645)","168","688","13500","643","13500","584","13500"
|
||||
"(4.896790766836212, -6.651052230903183, 3.930674313872201)","(9.735686576422808, 6.276220919977469, 3.901465820211406)","169","7103","13500","7210","13500","7305","13500"
|
||||
"(0.5627614565944529, 3.8736393599717327, -3.447033026199204)","(-4.345213160178996, 2.8392073631612043, 4.14840656071423)","170","687","13500","742","13500","747","13500"
|
||||
"(-5.137158212625378, -1.1215860863203122, 1.694501297046372)","(-6.5193303942583025, -7.218460435454215, 3.928244992554956)","171","780","13500","890","13500","974","13500"
|
||||
"(-5.366888121449161, -4.902385241113064, 1.4033689823793614)","(-2.094440358257783, -1.8652165421866904, 3.6010845331058308)","172","156","13500","197","13500","72","13500"
|
||||
"(2.783441769569254, -7.636252301354577, 5.644298818805672)","(1.9113604095297454, 2.631481223576573, 3.815607429300691)","173","345","13500","231","13500","170","13500"
|
||||
"(0.09347693332479355, -2.807169363682193, -2.724758833457667)","(6.674682720815952, -2.2522286365290096, 4.272826560412427)","174","6856","13500","7071","13500","7285","13500"
|
||||
"(-3.563368578134643, -7.978208270160181, 0.9521111734287535)","(4.967974304894, 0.6638440198916697, 3.5069046533995016)","175","637","13500","469","13500","455","13500"
|
||||
"(-3.620780927951897, -5.118800094338342, 6.260841226078666)","(0.7738302682962548, -5.620543105807809, 4.2778943448230216)","176","401","13500","360","13500","259","13500"
|
||||
"(5.153925352303816, -3.001217532550752, 6.736337010081861)","(-6.458004349674944, -0.6077136667595173, 4.437954883927154)","177","7353","13500","7355","13500","7537","13500"
|
||||
"(6.433399115954887, 0.9259788101180393, -5.143788490685271)","(-1.3717317558522382, -7.572408120833797, 3.5868347485930996)","178","660","13500","807","13500","828","13500"
|
||||
"(-3.1432755700247856, 7.372423575081288, -2.4807158715538584)","(-8.595352018702364, 3.04247982253524, 4.3201197609183)","179","6478","13500","6789","13500","7036","13500"
|
||||
"(-7.334259175615756, 0.903755159473261, -2.4089934348266437)","(-7.329525964230321, -1.4078049264463033, 3.9881912271779836)","180","623","13500","734","13500","852","13500"
|
||||
"(4.320789082714118, -4.448805217361943, 4.637328906560968)","(4.704453102446655, -0.8384389581081919, 4.458355341497789)","181","380","13500","322","13500","316","13500"
|
||||
"(-0.018650199865857944, 9.055652380607492, 0.9605689779008317)","(7.224580878748171, 6.1282704804179815, 4.303424579193382)","182","803","13500","864","13500","981","13500"
|
||||
"(-7.571854705693767, -5.102223025852777, 0.7632345929752224)","(-2.7985597113653533, -8.63060991562106, 4.068179077180271)","183","736","13500","870","13500","996","13500"
|
||||
"(5.076950913773819, 0.6622100816603843, 1.155510660455938)","(-9.37236424244375, -1.3001541516953878, 4.069392719732141)","184","6983","13500","7110","13500","7327","13500"
|
||||
"(-4.0061209474047335, -4.164514902442327, -2.324717878600358)","(2.1811687285036907, 4.257477580214308, 4.340574007666479)","185","393","13500","471","13500","430","13500"
|
||||
"(5.098647474519635, 4.551629844454239, 0.11170174311296478)","(-1.4427579519788303, 3.6807176286812293, 3.9285730225391426)","186","710","13500","781","13500","722","13500"
|
||||
"(-0.7260222815403494, -5.2640026253437515, -4.184567402261561)","(2.2981839902840395, -9.074646801035765, 3.864791877405535)","187","7582","13500","7776","13500","7624","13500"
|
||||
"(-4.042702344663609, 3.370816869437506, -1.3509155381706934)","(-3.985381310824458, -4.811221980342896, 3.8290753779052342)","188","7299","13500","7256","13500","7329","13500"
|
||||
"(2.580522922250784, 2.7018574559541073, -2.9294832498632393)","(1.4463841074680985, 6.4977731848378575, 3.5683248855418173)","189","7264","13500","7333","13500","7401","13500"
|
||||
"(-5.278476278848105, 4.917121445186693, 5.199792953636402)","(-3.7730027269113435, 4.012702747819681, 3.9314897095393313)","190","323","13500","293","13500","74","13500"
|
||||
"(-2.555903639162523, 2.5652468607652112, -8.911608197263993)","(8.522934071498582, 4.98128218004023, 4.163168994878177)","191","862","13500","992","13500","1022","13500"
|
||||
"(-2.9922790011715192, 3.367466227428349, 3.879886767359141)","(2.999288373876807, 1.139913425895081, 3.7049433125042412)","192","454","13500","472","13500","434","13500"
|
||||
"(-3.385950697902097, -2.1988636295950905, 8.527448583276447)","(9.678227226150536, -1.5740498274972143, 3.599720660931662)","193","7312","13500","7224","13500","7183","13500"
|
||||
"(-4.233180523114428, 2.270102696499489, -8.021682166042417)","(-5.0697074679146255, 0.5216359815874245, 4.012091279479603)","194","553","13500","632","13500","594","13500"
|
||||
"(-4.256593552156642, -5.637242455965131, -0.17926240522987857)","(0.6403680971807617, -4.289242213002337, 3.6172236737295016)","195","654","13500","616","13500","418","13500"
|
||||
"(-2.1956790439208183, 9.683597223750699, 0.5621454112671129)","(-6.005155500415675, -1.7242361165695748, 3.6100066481584374)","196","811","13500","849","13500","913","13500"
|
||||
"(1.960275828032613, 2.8548860554392195, 4.882458073491911)","(4.28488155834286, 1.5540091435580514, 3.9704981452911365)","197","364","13500","394","13500","299","13500"
|
||||
"(-4.510094565183903, 2.5822623980397093, -3.111492721859482)","(-3.6554975974064474, -2.4496384391024133, 3.707697062475661)","198","852","13500","891","13500","1041","13500"
|
||||
"(6.4351168512488695, -4.271372921678365, 5.062110412551709)","(0.7509004247881652, -0.08517618844684094, 3.550461690486226)","199","138","13500","77","13500","6","13500"
|
||||
"(2.7459026179700974, -2.629030253572244, 5.07662385823507)","(-0.03279425576741701, -7.725085365673873, 4.024150369164768)","200","714","13500","769","13500","868","13500"
|
||||
"(4.310423841335989, -2.6948438131363632, 1.3513325604784465)","(1.8922452640528178, -8.113024630692134, 4.15296950734641)","201","766","13500","838","13500","932","13500"
|
||||
"(3.2355566452151785, -2.1814266669755016, -1.540148729241694)","(5.106023479702188, 0.5721260719047905, 3.5941869516758964)","202","5404","13500","5681","13500","6007","13500"
|
||||
"(-1.6526208830762856, -4.0710180085553445, -0.20996114593148318)","(-0.8449908999963274, 9.465658074109417, 4.461976454243868)","203","7476","13500","7401","13500","7499","13500"
|
||||
"(3.47858698226061, -5.3330021526834255, 5.886335318445019)","(-5.146904841157918, 3.560119442164254, 4.465069837236828)","204","7674","13500","7721","13500","7651","13500"
|
||||
"(-3.164503090897395, -4.850505053626976, 5.366848283687694)","(0.039617988721989406, 0.5479258503312767, 4.030536672356043)","205","255","13500","181","13500","118","13500"
|
||||
"(-2.945397527281661, -2.6582045914203767, -0.2954895045003287)","(-8.063868164317253, -3.167544883444857, 4.029764919932627)","206","7505","13500","7525","13500","7533","13500"
|
||||
"(4.450477550131069, 4.778440039556041, -3.8674087577224125)","(-4.884637331979416, 2.895185470687311, 4.32706633900349)","207","623","13500","592","13500","570","13500"
|
||||
"(-4.565195814992882, 0.5710438327331665, -2.7059942669046317)","(-8.445641010564493, 1.482961775428242, 4.431551187436158)","208","7632","13500","7707","13500","7687","13500"
|
||||
"(-0.9163644096092689, -1.1037256789268381, -1.2051163309813224)","(-8.77471844084133, -5.7195182247259435, 3.6479784040854226)","209","7276","13500","7289","13500","7242","13500"
|
||||
"(8.288623206386946, -2.2446162925545687, -1.2316539077472481)","(-1.7553162560036988, -3.2064674284283505, 4.381483821008189)","210","573","13500","562","13500","583","13500"
|
||||
"(-2.5960250138431435, 8.084429902176822, 2.749334496371391)","(0.885222840911954, 8.718447170539037, 4.1180439702284)","211","666","13500","778","13500","812","13500"
|
||||
"(3.0205695168405304, 3.9464847000105743, -3.202103497982185)","(-8.360745028996558, 4.7252419918736255, 3.888900906220894)","212","7020","13500","7123","13500","7284","13500"
|
||||
"(-1.8918425302737705, -9.5209053853707, -1.0215458350141768)","(-1.9937047024980679, 4.844464276797037, 3.9688897744321676)","213","462","13500","413","13500","324","13500"
|
||||
"(2.4018430209336996, 3.577426959934166, -5.986927627324137)","(7.219792986680741, -0.040552892792046435, 3.831263471576233)","214","6806","13500","7032","13500","7393","13500"
|
||||
"(6.4586454757916325, 2.976365939511172, 6.63449119791294)","(7.2424225068005335, 3.714825098610694, 4.2624077183618345)","215","622","13500","622","13500","526","13500"
|
||||
"(1.3801947160063177, 3.230203493210796, -8.727103987606212)","(-6.173347810920293, 3.4807181407118986, 4.096181352487281)","216","647","13500","617","13500","510","13500"
|
||||
"(-0.31510238082505704, -3.5381991953798986, 3.5742276509393593)","(-1.7163182110800594, 3.3013991257602733, 4.309064766060426)","217","670","13500","778","13500","874","13500"
|
||||
"(-3.362882094817291, -4.317546357434529, -7.561489020134845)","(-7.584652912658454, 9.410208212237496, 4.14129762944281)","218","7154","13500","7153","13500","7166","13500"
|
||||
"(4.432384935412287, 5.818521022643919, -5.527763473459468)","(-3.3286954324641, -8.634930839809819, 3.844005681763873)","219","723","13500","784","13500","801","13500"
|
||||
"(-0.5697568900906339, 4.761381846432504, -6.365465504150983)","(-3.028568155205993, 6.573022171630129, 4.266030893012231)","220","7449","13500","7581","13500","7397","13500"
|
||||
"(6.7986602112327175, 1.3482473282161413, 3.569586497604365)","(8.73928420322289, -2.713811425926722, 3.59718930045055)","221","612","13500","748","13500","849","13500"
|
||||
"(7.002409725233073, -6.9217091364810726, 0.2928446868597578)","(1.3236906321668158, 6.794812116548936, 4.104675840603169)","222","731","13500","683","13500","631","13500"
|
||||
"(-0.17151639451535794, 6.8274874154639305, 5.663255656653451)","(-7.522071899381468, -8.292911994707111, 3.753032956658852)","223","7419","13500","7392","13500","7431","13500"
|
||||
"(6.539687704786437, 2.1916895373174934, -6.073899312397153)","(-4.1230836070677075, 3.8578834044356327, 3.6972856489079566)","224","431","13500","320","13500","213","13500"
|
||||
"(-2.700277151234067, -3.3089722444425727, -4.723196071127398)","(5.399545869974155, 6.64153213548596, 3.565097816529195)","225","705","13500","805","13500","847","13500"
|
||||
"(3.3269162194123494, 6.317835061552028, -1.0465579726151917)","(-8.655596087413533, -0.21739214368463067, 4.460958713890624)","226","4011","13500","3858","13500","3675","13500"
|
||||
"(6.959271637787844, -5.075904400516348, 4.5772462185663905)","(4.4864603399618765, 2.5488146127954145, 4.011148658144335)","227","467","13500","341","13500","244","13500"
|
||||
"(-3.1824859426590146, 3.888594956569976, -8.626609254348887)","(-6.495423287517987, 4.251400987992753, 3.961201474167445)","228","7140","13500","7203","13500","7374","13500"
|
||||
"(8.048029603177831, -0.49497226089426016, -5.09926782750264)","(4.995673696837109, -6.2656722378942025, 4.330804290544025)","229","6965","13500","6994","13500","7130","13500"
|
||||
"(7.992406682572186, -1.7383277936924146, 2.7688197873977747)","(0.6939266963629152, 6.8754636052842635, 3.962292306082443)","230","782","13500","860","13500","896","13500"
|
||||
"(7.090389777695811, -5.961179038819258, 3.758132516762038)","(9.628471516332876, -8.088432918062662, 3.98225077514736)","231","779","13500","850","13500","1004","13500"
|
||||
"(-1.3735771501843883, -2.526632991499769, -1.9545753374751973)","(4.433219661741791, -0.6896509416698589, 4.400553646100556)","232","840","13500","878","13500","816","13500"
|
||||
"(4.602879181524707, -3.7279193416290886, 1.241834175536131)","(-4.750845641893666, -0.7368050892977678, 4.2347615443268145)","233","849","13500","867","13500","995","13500"
|
||||
"(1.1151751877504286, -3.6592892748296975, -2.7599049481280424)","(-4.620195505061235, 6.865201848306118, 4.49685997017599)","234","912","13500","1048","13500","1062","13500"
|
||||
"(-3.816412766463004, -7.817714838951199, -1.8437662150164804)","(-8.006149948179262, -3.5986779709994714, 4.088628431170968)","235","761","13500","818","13500","900","13500"
|
||||
"(5.567916713788745, 3.4451888233447203, -6.2339967228765705)","(-1.8334764334628382, -7.996440833004945, 4.113541572155274)","236","618","13500","656","13500","718","13500"
|
||||
"(-1.333067069169896, 2.6622743736190326, 0.9016061620499106)","(-2.3727593557920734, -0.44347779691844025, 4.457883093912779)","237","834","13500","878","13500","1009","13500"
|
||||
"(2.980859650684681, 1.4770921263986097, -0.6069878783497601)","(-3.806211473332084, 8.074812637110668, 3.9746942635459828)","238","7425","13500","7230","13500","7429","13500"
|
||||
"(5.410328317718305, 4.395401518754597, 3.826116054481932)","(1.91433916609245, 5.439764500070405, 4.068217249655051)","239","321","13500","374","13500","382","13500"
|
||||
"(0.49041208115818713, 1.0474805754272496, 3.879530501165184)","(-2.128418260090317, 9.1239670884733, 3.9643160450857957)","240","7187","13500","7140","13500","7168","13500"
|
||||
"(6.0893485585736595, 4.566658147541606, 2.3537128982239084)","(6.920210179559948, -8.352948999231657, 3.623681393222669)","241","7104","13500","7093","13500","7114","13500"
|
||||
"(-3.640987430021397, -4.497281115701658, 6.925257984362465)","(-1.8286877880503027, -2.205523894608186, 4.420763172015391)","242","208","13500","162","13500","172","13500"
|
||||
"(8.803789474210255, -2.9741800286557893, 0.9963972744434003)","(-0.21052049809007833, 9.615406513105032, 3.9557435602607898)","243","6979","13500","7125","13500","7274","13500"
|
||||
"(5.64854352699427, -0.24843776108756294, -6.556087781401064)","(7.1620103431885695, 0.25034881973108725, 3.5846688654896854)","244","7625","13500","7680","13500","7600","13500"
|
||||
"(6.423087799363651, -1.4352038636301925, -3.2929444924200464)","(6.254551117767225, 4.622920723668649, 4.13597821188101)","245","7351","13500","7394","13500","7323","13500"
|
||||
"(-1.7432991102748774, 7.76707323200376, 0.3039247925890546)","(3.8316245827121076, -9.900790011767453, 3.779788494984312)","246","748","13500","814","13500","988","13500"
|
||||
"(-1.4146786364650727, 0.5442234517684579, 8.92863087143318)","(4.6694166858995025, -6.415822486861229, 4.4440795155348525)","247","836","13500","892","13500","846","13500"
|
||||
"(6.9098620554428285, -5.193743092746863, -4.522133514626585)","(0.1713765988514595, -5.182604718022661, 3.931325891407762)","248","738","13500","771","13500","960","13500"
|
||||
"(3.1274407524651546, -3.4156853952391373, -6.611570347008063)","(-0.6124344189098458, -7.609058522591612, 3.577832869217526)","249","7266","13500","7345","13500","7426","13500"
|
||||
"(3.7361776202397237, 0.2497038504553365, 7.091777982790259)","(-0.1579088124044894, -1.9898937415460072, 4.236917287081914)","250","200","13500","191","13500","102","13500"
|
||||
"(-0.9803652269584037, -3.887739473571792, 3.7067878973519344)","(-6.241972251119163, -9.595320373978026, 4.42491216501989)","251","7366","13500","7448","13500","7537","13500"
|
||||
"(2.253447722586825, 3.14972826232056, 7.931997776571022)","(-1.8095839727800964, -6.04396480730681, 4.092547973979087)","252","789","13500","872","13500","884","13500"
|
||||
"(-3.6859148062468603, -2.625686458436117, 6.777974133627015)","(-4.417989945115821, -3.583511574131471, 4.369258402492047)","253","569","13500","478","13500","438","13500"
|
||||
"(0.445794082323579, -5.2069978836033615, 2.9600908188792436)","(6.515534977052027, 7.757376601852563, 3.6674674886709857)","254","7344","13500","7392","13500","7343","13500"
|
||||
"(0.7319654065456462, 1.4657583880909175, -4.166005877967497)","(-2.0478582909828003, -3.0505975998211454, 4.428769095363148)","255","649","13500","644","13500","582","13500"
|
||||
"(0.034447866130523974, 9.086277054080666, 3.9857021173890015)","(-4.821804957461682, -9.34488364074686, 4.403100046456149)","256","7568","13500","7632","13500","7684","13500"
|
||||
"(-4.85073558581062, -0.5094704356863903, 1.97347526697621)","(-3.2275386613304065, -1.5213819006428189, 4.175297941522908)","257","433","13500","588","13500","592","13500"
|
||||
"(-0.6823248729232884, 8.812540003774602, -3.047643133799784)","(8.942418248068684, -9.294469739339963, 3.516706908089378)","258","7521","13500","7406","13500","7572","13500"
|
||||
"(1.8546233718293597, 1.5802534683042393, 5.325396204777237)","(3.5022268701644883, -6.444152976977742, 4.369464382324004)","259","4466","13500","4764","13500","5071","13500"
|
||||
"(7.866839009291198, 2.091472121201791, -1.2759010540230287)","(-0.9642832928090783, 2.5785308964396556, 4.259467604192359)","260","605","13500","553","13500","525","13500"
|
||||
"(-7.3818628258166425, -5.518184102059817, 2.949854979662698)","(-8.160449634683726, -9.074034459228633, 3.765458725744995)","261","734","13500","838","13500","992","13500"
|
||||
"(6.008449351799509, 1.931571673390707, -5.039231340478411)","(6.927203035724972, -8.991971677688163, 3.680855442577234)","262","7383","13500","7193","13500","7310","13500"
|
||||
"(1.0126742264193922, 3.639068667257759, -2.518802631707931)","(-1.0688386763704987, 8.868394684864644, 4.232902455944388)","263","7490","13500","7699","13500","7551","13500"
|
||||
"(1.4630607318835742, -2.461240599358527, -0.2829709415684615)","(0.27775041172268367, 2.1643412129713635, 4.244400809860473)","264","7326","13500","7220","13500","7351","13500"
|
||||
"(4.438769759093346, 7.924292460923139, -1.6204589589264502)","(-7.313609859046812, 9.643112398887471, 4.0231469267776525)","265","7291","13500","7345","13500","7272","13500"
|
||||
"(-4.7789936493427705, 6.915984426369207, -5.2892339495078575)","(7.673521700258416, 2.190728212662078, 4.074695602781153)","266","752","13500","816","13500","799","13500"
|
||||
"(-5.474962875921454, 4.068836225459246, -0.3758442667049202)","(-3.6184030971837133, 2.3880218900943646, 4.367591624378055)","267","528","13500","642","13500","794","13500"
|
||||
"(-5.676397900945633, 2.707426690932239, 0.2037482619471008)","(-6.103081177780885, -4.423306572130112, 4.36576982709945)","268","7148","13500","7206","13500","7306","13500"
|
||||
"(-2.4975186974195096, 4.031555764166108, -5.121826104448301)","(5.654520590721043, 1.6759947790765128, 3.7497075186259017)","269","666","13500","568","13500","495","13500"
|
||||
"(5.204978242149137, -0.7568398278191991, 4.4400836751555515)","(3.663918648905277, 2.340717900442808, 3.808539649966702)","270","462","13500","402","13500","276","13500"
|
||||
"(6.097480052417524, -0.32902816100857507, -0.918813887694256)","(4.4654588123306915, -8.842784420804545, 3.627792274681396)","271","7181","13500","7237","13500","7150","13500"
|
||||
"(-6.578744816740139, 0.39828131014480145, -4.3688384999745224)","(-2.522843538173989, 0.9950700488200575, 4.092225760149776)","272","695","13500","724","13500","597","13500"
|
||||
"(4.760166386249342, 6.586494261070951, -4.576535210793576)","(-2.4535866555927432, -9.782503388923384, 3.9688250291599987)","273","784","13500","886","13500","1020","13500"
|
||||
"(-4.694741455622423, -2.8677172209785993, 1.3545410989921032)","(-2.0905244042906457, -4.153950659586969, 3.974185629624138)","274","562","13500","626","13500","692","13500"
|
||||
"(2.6747255417862386, 4.518804290298787, 3.418037053741071)","(2.886254321515139, 5.434363544952577, 3.7458482147785617)","275","666","13500","659","13500","588","13500"
|
||||
"(-0.9312622249998874, -1.0551992474714205, 0.1418525978658586)","(3.4971592444553927, -6.966760178196054, 3.5950502496116736)","276","7130","13500","7154","13500","7160","13500"
|
||||
"(-3.6241213456648382, -8.678647233484204, 0.14307598278602487)","(5.150553907565634, -3.31126987854854, 4.448941639778042)","277","2966","13500","2610","13500","2323","13500"
|
||||
"(-5.105513143934975, -4.667100013682883, -5.354940414011759)","(-8.495280630514817, -7.525915871464354, 3.965616454185019)","278","7618","13500","7788","13500","7727","13500"
|
||||
"(0.20255580646760743, 3.3225426891053282, -8.311275169240627)","(-6.051216730612623, -3.2588141183547847, 4.344577980906002)","279","710","13500","747","13500","662","13500"
|
||||
"(0.8959545948620398, -0.8413137946035655, -0.8028258067566533)","(-2.2001441463028133, -6.250040561148729, 3.6684619034939647)","280","7575","13500","7389","13500","7471","13500"
|
||||
"(0.29589605129208796, -6.203449044820406, 7.349457947516891)","(-9.431692114997858, -5.476060821578832, 4.388822633083711)","281","7380","13500","7421","13500","7253","13500"
|
||||
"(6.7713645492975925, -0.5427332810773952, 2.375497180309798)","(-8.243100381763139, 7.748793195355336, 4.320214619576609)","282","7408","13500","7457","13500","7482","13500"
|
||||
"(-7.920377923443096, -3.737260412634002, 2.891364691966941)","(7.128457960702008, -3.544037195222291, 3.661775359758502)","283","852","13500","884","13500","968","13500"
|
||||
"(-4.660624999097836, 0.13757352852141116, 2.6827151748443088)","(0.2794096543354847, 3.8925876284048684, 3.504571917140828)","284","508","13500","479","13500","502","13500"
|
||||
"(-2.0784021538888706, -5.220275475578642, -6.0502029383694875)","(-8.711511118945012, -1.2038134739208477, 4.169543710746331)","285","7144","13500","7107","13500","7192","13500"
|
||||
"(-2.821740141700186, 2.2629478998928945, -2.7710864815693683)","(3.9974095283703903, -0.5143262695491089, 3.6026703900930634)","286","518","13500","562","13500","494","13500"
|
||||
"(5.580920707192574, -5.557825048956928, -5.650072654203499)","(1.7303031972222946, 0.3239891290216317, 3.8878296555578515)","287","310","13500","236","13500","142","13500"
|
||||
"(-6.671333658865967, -0.6534537563967416, 0.9364245781512569)","(1.7240112051204335, -2.7604774591211996, 4.459040586803481)","288","823","13500","869","13500","926","13500"
|
||||
"(-5.201485823818369, -3.1198314984363322, -5.070311565805541)","(0.4043071608639952, -0.79672698661685, 4.074064173023088)","289","299","13500","194","13500","126","13500"
|
||||
"(-5.594959718701144, 1.3728237003973291, 7.119467563110263)","(-0.7601381524236999, -0.3540760325609291, 4.300031633764116)","290","158","13500","78","13500","60","13500"
|
||||
"(-2.987000887800007, -0.8324488469176713, -0.39904730378867204)","(-9.833065552383172, -9.076189671232855, 4.27158403053941)","291","7471","13500","7418","13500","7286","13500"
|
||||
"(-2.426719720132547, 3.0419372635769255, -5.741249276701389)","(5.298246496653325, 2.9386748122856545, 4.29222793924237)","292","695","13500","680","13500","517","13500"
|
||||
"(2.421958440064514, 1.6672979134263086, -1.8153007664693592)","(5.237887040490747, -8.300944331126338, 3.528071987099308)","293","7134","13500","7129","13500","7179","13500"
|
||||
"(-4.788897109344085, 3.2627560530954227, -2.220253056365446)","(7.937712328048313, -2.97650531959275, 3.9750024741472245)","294","796","13500","848","13500","946","13500"
|
||||
"(3.9426012615578254, 3.5305142037090893, 4.547093302231958)","(6.461750877881361, 6.422747215859673, 4.4729037676920065)","295","824","13500","915","13500","974","13500"
|
||||
"(-4.169198002913327, -3.39012748825277, -3.0488858916124313)","(4.655269412612345, -0.25007362718008075, 3.9980658823760606)","296","637","13500","632","13500","538","13500"
|
||||
"(-3.2125612392705873, 2.4772505193734218, 6.839459490315659)","(-1.980891778838842, 7.869062544792072, 4.460066214956658)","297","829","13500","932","13500","999","13500"
|
||||
"(3.9062781090771796, -2.4977593678603665, -6.816860160148891)","(-5.71675639969367, 4.493178100119938, 3.9610924656429294)","298","658","13500","656","13500","570","13500"
|
||||
"(5.510059248561131, 5.295093495028599, 4.346854179624615)","(-2.0040353439477343, -3.8674122805228954, 3.8873928922832137)","299","764","13500","786","13500","947","13500"
|
||||
"(-1.778801426767778, -8.234285230388869, 3.133343671467703)","(7.910430044326638, -4.208980040283155, 4.062809808459971)","300","7181","13500","7286","13500","7294","13500"
|
||||
"(-2.8042349364616856, 1.0542882226076007, 5.024807308594803)","(9.572098799316016, 8.138427119947288, 4.246527271649148)","301","7200","13500","7130","13500","7216","13500"
|
||||
"(-6.590343947577746, -2.958622532690026, 5.667872095304804)","(-9.297202253856092, -8.850624075345166, 4.231618054388619)","302","7456","13500","7571","13500","7627","13500"
|
||||
"(-2.071704469483684, -2.1288114759225567, -4.286491513946247)","(-8.959324553555028, 4.33890901083582, 3.9254233713283546)","303","7214","13500","7245","13500","7204","13500"
|
||||
"(1.4656518820056976, -5.543209340800559, 3.873134443130204)","(-0.4267831029017515, -7.677077599855695, 4.0392646586514935)","304","738","13500","778","13500","874","13500"
|
||||
"(6.802661158474651, -0.18139230999324163, -7.257517470140506)","(-4.92975537937113, -5.596888152192603, 4.467204389922615)","305","704","13500","748","13500","686","13500"
|
||||
"(5.164290500632471, 4.188092332137302, 6.0386007404451805)","(-1.8406327952464263, 3.3102704417729143, 3.5992153746702993)","306","217","13500","146","13500","84","13500"
|
||||
"(1.128896385862166, 0.03775316356529975, 1.891914085648137)","(-0.8501422086311194, -3.515505999075595, 4.001618374026658)","307","812","13500","903","13500","952","13500"
|
||||
"(-3.413172940929819, 6.587350310094445, -4.274483170579685)","(5.241293027285199, 8.677323059613073, 4.17903163958537)","308","7342","13500","7482","13500","7327","13500"
|
||||
"(-1.884917513500519, 6.23688733187869, -6.293740476817828)","(-5.616553474430328, 9.6365700242353, 4.319272123727423)","309","7517","13500","7691","13500","7759","13500"
|
||||
"(8.687306504334341, 2.253124715452999, 0.4268936824115399)","(8.610727638741654, -1.1833700282160091, 4.3305830260367975)","310","738","13500","801","13500","938","13500"
|
||||
"(-4.186826924515315, -0.1376837434996824, 7.11576737233478)","(7.760582155186405, -2.1651664189423236, 4.174525055980059)","311","7275","13500","7241","13500","7196","13500"
|
||||
"(-7.666158570666806, -0.1703508065617383, 3.55492666059719)","(-5.819242285691979, 0.9823660494473963, 4.060209765568927)","312","428","13500","450","13500","441","13500"
|
||||
"(1.7818543658887382, -2.9499624146787475, 2.321092662925912)","(-8.276022652116568, 0.9518966034946672, 3.916356887405732)","313","7103","13500","7143","13500","7102","13500"
|
||||
"(6.7620232098447755, -4.623845012589718, -0.08777171320202441)","(2.326569577694226, 1.2331729666187563, 3.660608056193049)","314","252","13500","298","13500","258","13500"
|
||||
"(-2.8895051143441055, 7.943834181321509, 4.717362322465975)","(-0.9461755569530723, 1.023844053617955, 4.01894509483118)","315","234","13500","197","13500","164","13500"
|
||||
"(-2.797002688322915, -4.61148440725945, -1.6514880441574173)","(9.614970457830609, -2.824781170550297, 3.8923703784658525)","316","7036","13500","7137","13500","7216","13500"
|
||||
"(-3.1092946772723913, 8.319942762665654, 3.379136237080132)","(-1.90925444716218, 3.143850598682027, 3.528753815286512)","317","290","13500","229","13500","238","13500"
|
||||
"(-5.365192162861112, -7.311882863503143, 3.5557635248116526)","(9.20109232744544, -1.9102174746924874, 3.713478306431688)","318","7013","13500","7097","13500","7299","13500"
|
||||
"(6.2845598133395075, 5.720681391644094, 2.9642694872166193)","(-0.04342669197574622, 2.5729497236824805, 3.7940591356842415)","319","376","13500","231","13500","166","13500"
|
||||
"(-3.6288830574502304, -5.187089596014159, 1.748871393588608)","(7.580241301593446, -3.456114141276432, 4.051169612446726)","320","7631","13500","7633","13500","7563","13500"
|
||||
"(-2.0116739713654463, -4.285933248514893, 6.518868125569906)","(-1.3629884517802964, -5.452828713659805, 3.951656740204201)","321","402","13500","475","13500","409","13500"
|
||||
"(4.697716407056832, -5.6112837032692315, 4.4719027967839775)","(-2.1052050479442013, -4.678094564875925, 3.892834483159558)","322","501","13500","436","13500","338","13500"
|
||||
"(-2.042565749683006, 0.9878641489607981, 8.688009835889813)","(6.089301627955521, -6.636662022901705, 4.228041818257188)","323","6812","13500","6983","13500","7218","13500"
|
||||
"(-6.764719973000999, 6.179128946436974, -2.4721752620189568)","(-9.78748468317879, -0.6802474425142968, 4.171991808398146)","324","7384","13500","7436","13500","7534","13500"
|
||||
"(-0.9809745006210796, 1.2956878323637726, -1.7711618059528533)","(7.831741448812878, -1.788166163777337, 4.329696451244208)","325","7307","13500","7403","13500","7231","13500"
|
||||
"(-3.682597792364819, -0.185853234243273, -3.8804307838614167)","(7.138783225290407, -9.819156635919825, 3.733607754691909)","326","7284","13500","7303","13500","7204","13500"
|
||||
"(3.4243444710548134, -1.6523013788216707, -2.694010139060982)","(-3.4502805135571606, -6.543258065075226, 3.7961150736240756)","327","7168","13500","7322","13500","7274","13500"
|
||||
"(6.589781133815182, -0.13045311767712078, 6.184896183754181)","(-0.3293102255060276, -9.54506129913409, 3.597896012704439)","328","6809","13500","7017","13500","7199","13500"
|
||||
"(-4.696442221441111, -5.247355875903176, -5.148947753864708)","(2.8418749717170435, -6.833131826841643, 4.379954044261717)","329","7556","13500","7455","13500","7555","13500"
|
||||
"(-4.2296735368896705, -4.599164474439893, -0.5671392144739533)","(8.158971119415746, 3.049241316041167, 3.727525267755795)","330","773","13500","828","13500","902","13500"
|
||||
"(0.09932350233881554, -6.976160164154345, -4.779450357426486)","(4.858313883476521, 9.336720075258963, 4.177764410612509)","331","764","13500","938","13500","959","13500"
|
||||
"(-4.606789017621154, -7.452157723217131, -3.617547171734161)","(6.891369869645267, -1.7824967007208965, 4.070967901147737)","332","767","13500","823","13500","848","13500"
|
||||
"(-4.020893642262086, -7.661407082050231, 1.121485834463917)","(5.46998176219153, 4.3929067622687885, 4.383125951945658)","333","729","13500","833","13500","1002","13500"
|
|
81
tests/calculations/__snapshots__/test_calculations.ambr
Normal file
81
tests/calculations/__snapshots__/test_calculations.ambr
Normal file
@ -0,0 +1,81 @@
|
||||
# serializer version: 1
|
||||
# name: test_multiple_electric_field_alphas
|
||||
list([
|
||||
list([
|
||||
0.009579434215333742,
|
||||
0.007714411624737791,
|
||||
0.0035604976729559034,
|
||||
]),
|
||||
list([
|
||||
0.005036717012002481,
|
||||
0.006259221141129298,
|
||||
-0.009682232702684382,
|
||||
]),
|
||||
list([
|
||||
0.01503516326014651,
|
||||
0.012028130608117207,
|
||||
0.009021097956087907,
|
||||
]),
|
||||
list([
|
||||
0.0033871215792458027,
|
||||
0.0038182097802407235,
|
||||
-0.005604146612933966,
|
||||
]),
|
||||
list([
|
||||
0.007409666906433089,
|
||||
0.006778734778841714,
|
||||
0.003467602973242188,
|
||||
]),
|
||||
list([
|
||||
0.004730939083250055,
|
||||
0.0046546336141653774,
|
||||
-0.011766303332857395,
|
||||
]),
|
||||
list([
|
||||
-0.010766266772985707,
|
||||
-0.012631289363581657,
|
||||
-0.010851040527103707,
|
||||
]),
|
||||
list([
|
||||
-0.008410828408392494,
|
||||
-0.020391368873835285,
|
||||
0.009877833363344673,
|
||||
]),
|
||||
list([
|
||||
-0.015035163260146511,
|
||||
-0.018042195912175815,
|
||||
-0.021049228564205113,
|
||||
]),
|
||||
list([
|
||||
-0.005850482727788205,
|
||||
-0.012193637685284892,
|
||||
0.0054809785555068454,
|
||||
]),
|
||||
list([
|
||||
-0.007682229585552562,
|
||||
-0.010584517372472879,
|
||||
-0.009352937859414517,
|
||||
]),
|
||||
list([
|
||||
-0.009767100042838822,
|
||||
-0.020831393060117175,
|
||||
0.014024945217763873,
|
||||
]),
|
||||
])
|
||||
# ---
|
||||
# name: test_multiple_electric_potential_alphas
|
||||
list([
|
||||
0.05035560994609065,
|
||||
-0.03369221379873504,
|
||||
0.07216878364870323,
|
||||
-0.024633611485424027,
|
||||
0.04496779459769236,
|
||||
-0.03108684810509794,
|
||||
-0.08019597139562586,
|
||||
0.08293468011996319,
|
||||
-0.10825317547305485,
|
||||
0.060044427995721066,
|
||||
-0.06935710692186449,
|
||||
0.08733923991432278,
|
||||
])
|
||||
# ---
|
102
tests/calculations/test_calculations.py
Normal file
102
tests/calculations/test_calculations.py
Normal file
@ -0,0 +1,102 @@
|
||||
import pdme.calculations
|
||||
import pytest
|
||||
import numpy
|
||||
import numpy.testing
|
||||
|
||||
|
||||
# generated in mathematica to compare here
|
||||
beta_test_data = [
|
||||
[-2, -2, 0.8072976151],
|
||||
[-1, -2, 0.008105366193],
|
||||
[0, -2, 0.00008105691406],
|
||||
[1, -2, 8.105694659e-7],
|
||||
[2, -2, 8.105694691e-9],
|
||||
[-2, -1, 5.768008783],
|
||||
[-1, -1, 0.08072976151],
|
||||
[0, -1, 0.0008105366193],
|
||||
[1, -1, 8.105691406e-6],
|
||||
[2, -1, 8.105694659e-8],
|
||||
[-2, 0, 1.951840272],
|
||||
[-1, 0, 0.5768008783],
|
||||
[0, 0, 0.008072976151],
|
||||
[1, 0, 0.00008105366193],
|
||||
[2, 0, 8.105691406e-7],
|
||||
[-2, 1, 0.1999506642],
|
||||
[-1, 1, 0.1951840272],
|
||||
[0, 1, 0.05768008783],
|
||||
[1, 1, 0.0008072976151],
|
||||
[2, 1, 8.105366193e-6],
|
||||
[-2, 2, 0.01999995065],
|
||||
[-1, 2, 0.01999506642],
|
||||
[0, 2, 0.01951840272],
|
||||
[1, 2, 0.005768008783],
|
||||
[2, 2, 0.00008072976151],
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("f, w, expected", beta_test_data)
|
||||
def test_calculations_beta_func(f, w, expected):
|
||||
# there's nothing special about the 5 * 10^ f and 10^w passing in logs
|
||||
# this was just to get a variety of orders of magnitude in results.
|
||||
actual = pdme.calculations.telegraph_beta(5 * 10**f, 10**w)
|
||||
numpy.testing.assert_allclose(actual, expected, atol=0, rtol=1e-8)
|
||||
|
||||
|
||||
def test_multiple_electric_potential_alphas(snapshot):
|
||||
"""
|
||||
Manually compare these with mathematica stuff because manually including a list is a bit annoying.
|
||||
Basically just visually compare the snapshot values to make sure they're actually correct.
|
||||
"""
|
||||
dipole_ps = [
|
||||
numpy.array([1, 2, 3]),
|
||||
numpy.array([-4, -3, -2]),
|
||||
]
|
||||
dipole_ss = [
|
||||
numpy.array([0, 0, 1]),
|
||||
numpy.array([1, 1, 1]),
|
||||
numpy.array([0, -0.5, 0.5]),
|
||||
]
|
||||
|
||||
test_rs = [
|
||||
numpy.array([5, 5, 5]),
|
||||
numpy.array([-4, -6, 2]),
|
||||
]
|
||||
|
||||
actuals = [
|
||||
pdme.calculations.electric_potential(p, s, r)
|
||||
for p in dipole_ps
|
||||
for s in dipole_ss
|
||||
for r in test_rs
|
||||
]
|
||||
|
||||
assert actuals == snapshot
|
||||
|
||||
|
||||
def test_multiple_electric_field_alphas(snapshot):
|
||||
"""
|
||||
Manually compare these with mathematica stuff because manually including a list is a bit annoying.
|
||||
Basically just visually compare the snapshot values to make sure they're actually correct.
|
||||
"""
|
||||
dipole_ps = [
|
||||
numpy.array([1, 2, 3]),
|
||||
numpy.array([-4, -3, -2]),
|
||||
]
|
||||
dipole_ss = [
|
||||
numpy.array([0, 0, 1]),
|
||||
numpy.array([1, 1, 1]),
|
||||
numpy.array([0, -0.5, 0.5]),
|
||||
]
|
||||
|
||||
test_rs = [
|
||||
numpy.array([5, 5, 5]),
|
||||
numpy.array([-4, -6, 2]),
|
||||
]
|
||||
|
||||
actuals = [
|
||||
pdme.calculations.electric_field(p, s, r).tolist()
|
||||
for p in dipole_ps
|
||||
for s in dipole_ss
|
||||
for r in test_rs
|
||||
]
|
||||
|
||||
assert actuals == snapshot
|
38
tests/inputs/test_dot_inputs.py
Normal file
38
tests/inputs/test_dot_inputs.py
Normal file
@ -0,0 +1,38 @@
|
||||
import pdme.inputs
|
||||
|
||||
|
||||
def test_inputs_with_frequency_range():
|
||||
dot1 = [1, 2, 3]
|
||||
dot2 = [2, 4, 6]
|
||||
|
||||
frequencies = [5, 7, 9]
|
||||
|
||||
expected = [
|
||||
([1, 2, 3], 5),
|
||||
([1, 2, 3], 7),
|
||||
([1, 2, 3], 9),
|
||||
([2, 4, 6], 7),
|
||||
([2, 4, 6], 9),
|
||||
([2, 4, 6], 5),
|
||||
]
|
||||
|
||||
actual = pdme.inputs.inputs_with_frequency_range([dot1, dot2], frequencies)
|
||||
|
||||
assert sorted(actual) == sorted(expected), "Did not actually match dot inputs!"
|
||||
|
||||
|
||||
def test_input_pairs_with_frequency_range():
|
||||
dot1 = [1, 2, 3]
|
||||
dot2 = [2, 4, 6]
|
||||
|
||||
frequencies = [5, 7, 9]
|
||||
|
||||
expected = [
|
||||
([1, 2, 3], [2, 4, 6], 5),
|
||||
([1, 2, 3], [2, 4, 6], 7),
|
||||
([1, 2, 3], [2, 4, 6], 9),
|
||||
]
|
||||
|
||||
actual = pdme.inputs.input_pairs_with_frequency_range([dot1, dot2], frequencies)
|
||||
|
||||
assert sorted(actual) == sorted(expected), "Did not actually match dot inputs!"
|
@ -2,21 +2,173 @@ import numpy
|
||||
import pdme.measurement
|
||||
|
||||
|
||||
def test_static_dipole():
|
||||
d1 = pdme.measurement.OscillatingDipole((1, 2, 3), (4, 5, 6), 7)
|
||||
d2 = pdme.measurement.OscillatingDipole((2, 5, 3), (4, -5, -6), 2)
|
||||
def test_static_dipole_electric_potential():
|
||||
d1 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array((1, 2, 3)), numpy.array([4, 5, 6]), 7
|
||||
)
|
||||
d2 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([2, 5, 3]), numpy.array([4, -5, -6]), 2
|
||||
)
|
||||
dipoles = pdme.measurement.OscillatingDipoleArrangement([d1, d2])
|
||||
|
||||
dot_position1 = (-1, -1, -1)
|
||||
dot_position1 = numpy.array([-1, -1, -1])
|
||||
dot_frequency1 = 11
|
||||
expected_v1 = 0.00001421963287022476
|
||||
expected_v2 = 0.00001107180225755457
|
||||
|
||||
numpy.testing.assert_allclose(d1.s_at_position(dot_position1, dot_frequency1), expected_v1, err_msg="Voltage at dot isn't as expected.")
|
||||
expected_v1 = 0.00001221710876727626
|
||||
expected_v2 = 7.257229625870065e-6
|
||||
|
||||
dot_measurements = dipoles.get_dot_measurements([(dot_position1, dot_frequency1)])
|
||||
numpy.testing.assert_allclose(
|
||||
d1.s_electric_potential_at_position(dot_position1, dot_frequency1),
|
||||
expected_v1,
|
||||
err_msg="Voltage at dot isn't as expected.",
|
||||
)
|
||||
|
||||
dot_measurements = dipoles.get_potential_dot_measurements(
|
||||
[(dot_position1, dot_frequency1)]
|
||||
)
|
||||
assert len(dot_measurements) == 1, "Should have only had one dot measurement."
|
||||
measurement = dot_measurements[0]
|
||||
numpy.testing.assert_allclose(measurement.r, dot_position1, err_msg="Dot position should have been passed over")
|
||||
numpy.testing.assert_allclose(measurement.f, dot_frequency1, err_msg="Dot frequency should have been passed over")
|
||||
numpy.testing.assert_allclose(measurement.v, expected_v1 + expected_v2, err_msg="Voltage at dot isn't as expected.")
|
||||
numpy.testing.assert_allclose(
|
||||
measurement.r,
|
||||
dot_position1,
|
||||
err_msg="Dot position should have been passed over",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
measurement.f,
|
||||
dot_frequency1,
|
||||
err_msg="Dot frequency should have been passed over",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
measurement.v,
|
||||
expected_v1 + expected_v2,
|
||||
err_msg="Voltage at dot isn't as expected.",
|
||||
)
|
||||
|
||||
|
||||
def test_static_dipole_electric_field_x():
|
||||
d1 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array((1, 2, 3)), numpy.array([4, 5, 6]), 7
|
||||
)
|
||||
d2 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([2, 5, 3]), numpy.array([4, -5, -6]), 2
|
||||
)
|
||||
# dipoles = pdme.measurement.OscillatingDipoleArrangement([d1, d2])
|
||||
|
||||
dot_position1 = numpy.array([-1, -1, -1])
|
||||
dot_frequency1 = 11
|
||||
|
||||
# these should be true for electric field
|
||||
expected_v1 = 1.479556451978925e-7
|
||||
expected_v2 = 6.852024308908262e-7
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
d1.s_electric_fieldx_at_position(dot_position1, dot_frequency1),
|
||||
expected_v1,
|
||||
err_msg="Fieldx noise at dot isn't as expected.",
|
||||
)
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
d2.s_electric_fieldx_at_position(dot_position1, dot_frequency1),
|
||||
expected_v2,
|
||||
err_msg="Fieldx at dot isn't as expected.",
|
||||
)
|
||||
|
||||
|
||||
def test_dipole_dot_pair():
|
||||
d1 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([1, 2, 3]), numpy.array([4, 5, 6]), 7
|
||||
)
|
||||
dipoles = pdme.measurement.OscillatingDipoleArrangement([d1])
|
||||
|
||||
dot_position1 = numpy.array([-1, -1, -1])
|
||||
dot_position2 = numpy.array([1, 2, 3])
|
||||
dot_frequency = 8
|
||||
expected_sij = 0.00008692058236162933
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
d1.s_electric_potential_for_dot_pair(
|
||||
dot_position1, dot_position2, dot_frequency
|
||||
),
|
||||
expected_sij,
|
||||
err_msg="Sij for dot pair isn't as expected.",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
[
|
||||
m.v
|
||||
for m in dipoles.get_potential_dot_pair_measurements(
|
||||
[(dot_position1, dot_position2, dot_frequency)]
|
||||
)
|
||||
],
|
||||
[expected_sij],
|
||||
err_msg="Sij for dot pair isn't as expected via dipole.",
|
||||
)
|
||||
|
||||
|
||||
def test_range_pairs():
|
||||
d1 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([1, 2, 3]), numpy.array([4, 5, 6]), 7
|
||||
)
|
||||
dipoles = pdme.measurement.OscillatingDipoleArrangement([d1])
|
||||
|
||||
dot_position1 = numpy.array([-1, -1, -1])
|
||||
dot_position2 = numpy.array([1, 2, 3])
|
||||
dot_frequency = 8
|
||||
expected_sij = 0.00008692058236162933
|
||||
|
||||
actuals = dipoles.get_percent_range_potential_dot_pair_measurements(
|
||||
[(dot_position1, dot_position2, dot_frequency)], 0.5, 1.5
|
||||
)
|
||||
assert len(actuals) == 1, "should have only been one pair"
|
||||
actual = actuals[0]
|
||||
numpy.testing.assert_allclose(
|
||||
[actual.v_low, actual.v_high],
|
||||
expected_sij * numpy.array([0.5, 1.5]),
|
||||
err_msg="Sij for dot pair isn't as expected via dipole with range.",
|
||||
)
|
||||
|
||||
|
||||
def test_range_dipole_measurements():
|
||||
d1 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([1, 2, 3]), numpy.array([4, 5, 6]), 7
|
||||
)
|
||||
d2 = pdme.measurement.OscillatingDipole(
|
||||
numpy.array([2, 5, 3]), numpy.array([4, -5, -6]), 2
|
||||
)
|
||||
dipoles = pdme.measurement.OscillatingDipoleArrangement([d1, d2])
|
||||
|
||||
dot_position1 = numpy.array([-1, -1, -1])
|
||||
dot_frequency1 = 11
|
||||
expected_v1 = 0.00001221710876727626
|
||||
expected_v2 = 7.257229625870065e-6
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
d1.s_electric_potential_at_position(dot_position1, dot_frequency1),
|
||||
expected_v1,
|
||||
err_msg="Voltage at dot isn't as expected.",
|
||||
)
|
||||
|
||||
range_dot_measurements = dipoles.get_percent_range_potential_dot_measurements(
|
||||
[(dot_position1, dot_frequency1)], 0.5, 1.5
|
||||
)
|
||||
assert len(range_dot_measurements) == 1, "Should have only had one dot measurement."
|
||||
range_measurement = range_dot_measurements[0]
|
||||
numpy.testing.assert_allclose(
|
||||
range_measurement.r,
|
||||
dot_position1,
|
||||
err_msg="Dot position should have been passed over",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
range_measurement.f,
|
||||
dot_frequency1,
|
||||
err_msg="Dot frequency should have been passed over",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
range_measurement.v_low,
|
||||
(expected_v1 + expected_v2) / 2,
|
||||
err_msg="Lower voltage at dot isn't as expected.",
|
||||
)
|
||||
numpy.testing.assert_allclose(
|
||||
range_measurement.v_high,
|
||||
(expected_v1 + expected_v2) * 3 / 2,
|
||||
err_msg="Lower oltage at dot isn't as expected.",
|
||||
)
|
||||
|
24
tests/measurement/test_dipole_to_array.py
Normal file
24
tests/measurement/test_dipole_to_array.py
Normal file
@ -0,0 +1,24 @@
|
||||
import numpy
|
||||
import pdme.measurement
|
||||
|
||||
|
||||
def test_dipole_to_array():
|
||||
d1 = pdme.measurement.OscillatingDipole((1, 2, 3), (4, 5, 6), 7)
|
||||
d2 = pdme.measurement.OscillatingDipole((1.5, 2.5, 3.5), (4.5, 5.5, 6.5), 7.5)
|
||||
|
||||
expected1 = numpy.array([1, 2, 3, 4, 5, 6, 7])
|
||||
numpy.testing.assert_array_equal(
|
||||
expected1, d1.to_flat_array(), err_msg="Didn't convert 1 correctly to array"
|
||||
)
|
||||
|
||||
expected2 = numpy.array([1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5])
|
||||
numpy.testing.assert_array_equal(
|
||||
expected2, d2.to_flat_array(), err_msg="Didn't convert 2 correctly to array"
|
||||
)
|
||||
|
||||
arrangement = pdme.measurement.OscillatingDipoleArrangement([d1, d2])
|
||||
numpy.testing.assert_array_equal(
|
||||
[expected1, expected2],
|
||||
arrangement.to_numpy_array(),
|
||||
err_msg="Didn't convert multiple dipoles right",
|
||||
)
|
75
tests/measurement/test_measurement_range_swap.py
Normal file
75
tests/measurement/test_measurement_range_swap.py
Normal file
@ -0,0 +1,75 @@
|
||||
from pdme.measurement import DotRangeMeasurement
|
||||
from pdme.measurement import DotPairRangeMeasurement
|
||||
import numpy
|
||||
|
||||
|
||||
def test_swap_high_low():
|
||||
actual_high = 2
|
||||
actual_low = 1
|
||||
m1 = DotRangeMeasurement(actual_high, actual_low, 100, 1000)
|
||||
m2 = DotRangeMeasurement(actual_low, actual_high, 100, 1000)
|
||||
|
||||
numpy.testing.assert_array_equal(
|
||||
[m1.v_low, m1.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong with swap",
|
||||
)
|
||||
numpy.testing.assert_array_equal(
|
||||
[m2.v_low, m2.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong without swap",
|
||||
)
|
||||
|
||||
|
||||
def test_swap_high_low_negative():
|
||||
actual_high = -1
|
||||
actual_low = -2
|
||||
m1 = DotRangeMeasurement(actual_high, actual_low, 100, 1000)
|
||||
m2 = DotRangeMeasurement(actual_low, actual_high, 100, 1000)
|
||||
|
||||
numpy.testing.assert_array_equal(
|
||||
[m1.v_low, m1.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong with swap, negative",
|
||||
)
|
||||
numpy.testing.assert_array_equal(
|
||||
[m2.v_low, m2.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong without swap, negative",
|
||||
)
|
||||
|
||||
|
||||
def test_swap_high_low_pair():
|
||||
actual_high = 2
|
||||
actual_low = 1
|
||||
m1 = DotPairRangeMeasurement(actual_high, actual_low, 100, 1000, 10000)
|
||||
m2 = DotPairRangeMeasurement(actual_low, actual_high, 100, 1000, 10000)
|
||||
|
||||
numpy.testing.assert_array_equal(
|
||||
[m1.v_low, m1.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong with swap",
|
||||
)
|
||||
numpy.testing.assert_array_equal(
|
||||
[m2.v_low, m2.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong without swap",
|
||||
)
|
||||
|
||||
|
||||
def test_swap_high_low_pair_negative():
|
||||
actual_high = -1
|
||||
actual_low = -2
|
||||
m1 = DotPairRangeMeasurement(actual_high, actual_low, 100, 1000, 10000)
|
||||
m2 = DotPairRangeMeasurement(actual_low, actual_high, 100, 1000, 10000)
|
||||
|
||||
numpy.testing.assert_array_equal(
|
||||
[m1.v_low, m1.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong with swap, negative",
|
||||
)
|
||||
numpy.testing.assert_array_equal(
|
||||
[m2.v_low, m2.v_high],
|
||||
[actual_low, actual_high],
|
||||
err_msg="Highs were wrong without swap, negative",
|
||||
)
|
57
tests/measurement/test_measurement_to_arrays.py
Normal file
57
tests/measurement/test_measurement_to_arrays.py
Normal file
@ -0,0 +1,57 @@
|
||||
import numpy
|
||||
import pdme.measurement.input_types
|
||||
from pdme.measurement.dot_measure import DotRangeMeasurement
|
||||
from pdme.measurement.dot_pair_measure import DotPairRangeMeasurement
|
||||
|
||||
|
||||
def test_inputs_to_array():
|
||||
i1 = ([1, 2, 3], 5)
|
||||
i2 = ([-1, 4, -2], 9)
|
||||
|
||||
actual = pdme.measurement.input_types.dot_inputs_to_array([i1, i2])
|
||||
expected = numpy.array([[1, 2, 3, 5], [-1, 4, -2, 9]])
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
actual, expected, err_msg="Didn't convert to array properly"
|
||||
)
|
||||
|
||||
|
||||
def test_pair_inputs_to_array():
|
||||
i1 = ([1, 2, 3], [-1, 4, -2], 5)
|
||||
i2 = ([-1, 4, -2], [6, 7, 8], 9)
|
||||
|
||||
actual = pdme.measurement.input_types.dot_pair_inputs_to_array([i1, i2])
|
||||
expected = numpy.array(
|
||||
[
|
||||
[[1, 2, 3, 5], [-1, 4, -2, 5]],
|
||||
[[-1, 4, -2, 9], [6, 7, 8, 9]],
|
||||
]
|
||||
)
|
||||
|
||||
numpy.testing.assert_allclose(
|
||||
actual, expected, err_msg="Didn't convert to array properly"
|
||||
)
|
||||
|
||||
|
||||
def test_ranges_to_array():
|
||||
m1 = DotRangeMeasurement(1, 2, 100, 1000)
|
||||
m2 = DotRangeMeasurement(0.5, 3, 100, 1000)
|
||||
|
||||
(
|
||||
actual_lows,
|
||||
actual_highs,
|
||||
) = pdme.measurement.input_types.dot_range_measurements_low_high_arrays([m1, m2])
|
||||
numpy.testing.assert_allclose(actual_lows, [1, 0.5], err_msg="Lows were wrong")
|
||||
numpy.testing.assert_allclose(actual_highs, [2, 3], err_msg="Highs were wrong")
|
||||
|
||||
|
||||
def test_pair_ranges_to_array():
|
||||
m1 = DotPairRangeMeasurement(1, 2, 100, 1000, 10000)
|
||||
m2 = DotPairRangeMeasurement(0.5, 3, 100, 1000, 10000)
|
||||
|
||||
(
|
||||
actual_lows,
|
||||
actual_highs,
|
||||
) = pdme.measurement.input_types.dot_range_measurements_low_high_arrays([m1, m2])
|
||||
numpy.testing.assert_allclose(actual_lows, [1, 0.5], err_msg="Lows were wrong")
|
||||
numpy.testing.assert_allclose(actual_highs, [2, 3], err_msg="Highs were wrong")
|
@ -0,0 +1,55 @@
|
||||
# serializer version: 1
|
||||
# name: test_log_spaced_fixedxy_orientation_mcmc_basic
|
||||
list([
|
||||
tuple(
|
||||
3984.4199552664,
|
||||
array([[ 9.55610128, 2.94634152, 0. , 9.21529051, -2.46576127,
|
||||
2.42481096, 9.19034554]]),
|
||||
),
|
||||
tuple(
|
||||
8583.8032728084,
|
||||
array([[ 9.99991539, 0.04113671, 0. , 8.71258954, -2.26599865,
|
||||
2.60452102, 6.37042214]]),
|
||||
),
|
||||
tuple(
|
||||
6215.5671525452,
|
||||
array([[ 9.81950685, -1.89137124, 0. , 8.90637055, -2.48043039,
|
||||
2.28444435, 8.84239221]]),
|
||||
),
|
||||
tuple(
|
||||
424.7282747232,
|
||||
array([[ 1.00028483, 9.94984574, 0. , 8.53064898, -2.59230757,
|
||||
2.33774773, 8.6714416 ]]),
|
||||
),
|
||||
tuple(
|
||||
300.920463669,
|
||||
array([[ 1.4003442 , 9.90146636, 0. , 8.05557992, -2.6753126 ,
|
||||
2.65915755, 13.02021385]]),
|
||||
),
|
||||
tuple(
|
||||
2400.0053792245,
|
||||
array([[ 9.97761813, 0.66868263, 0. , 8.69171028, -2.73145011,
|
||||
2.90140456, 19.94999593]]),
|
||||
),
|
||||
tuple(
|
||||
5001.4154377966,
|
||||
array([[ 9.93976109, -1.09596962, 0. , 8.95245025, -2.59409162,
|
||||
2.90140456, 9.75535945]]),
|
||||
),
|
||||
tuple(
|
||||
195.2191433934,
|
||||
array([[ 0.20690762, 9.99785923, 0. , 9.59636585, -2.83240984,
|
||||
2.90140456, 16.14771567]]),
|
||||
),
|
||||
tuple(
|
||||
2698.2459654601,
|
||||
array([[-9.68130127, -2.50447712, 0. , 8.94823619, -2.92889659,
|
||||
2.77065328, 13.63173263]]),
|
||||
),
|
||||
tuple(
|
||||
1193.6653292625,
|
||||
array([[-6.16597091, -7.87278875, 0. , 9.62210721, -2.75993924,
|
||||
2.77065328, 5.64553534]]),
|
||||
),
|
||||
])
|
||||
# ---
|
@ -0,0 +1,55 @@
|
||||
# serializer version: 1
|
||||
# name: test_log_spaced_free_orientation_mcmc_basic
|
||||
list([
|
||||
tuple(
|
||||
3167.6603875494,
|
||||
array([[ 9.60483896, -1.41627817, -2.3960853 , -4.76615152, -1.80902942,
|
||||
2.11809123, 16.17452242]]),
|
||||
),
|
||||
tuple(
|
||||
3167.6603875494,
|
||||
array([[ 9.60483896, -1.41627817, -2.3960853 , -4.76615152, -1.80902942,
|
||||
2.11809123, 16.17452242]]),
|
||||
),
|
||||
tuple(
|
||||
3167.6603875494,
|
||||
array([[ 9.60483896, -1.41627817, -2.3960853 , -4.76615152, -1.80902942,
|
||||
2.11809123, 16.17452242]]),
|
||||
),
|
||||
tuple(
|
||||
2320.6090682509,
|
||||
array([[ 4.1660069 , -8.11557337, 4.0965663 , -4.35968351, -1.97945216,
|
||||
2.43615641, 12.92143144]]),
|
||||
),
|
||||
tuple(
|
||||
2320.6090682509,
|
||||
array([[ 4.1660069 , -8.11557337, 4.0965663 , -4.35968351, -1.97945216,
|
||||
2.43615641, 12.92143144]]),
|
||||
),
|
||||
tuple(
|
||||
2320.6090682509,
|
||||
array([[ 4.1660069 , -8.11557337, 4.0965663 , -4.35968351, -1.97945216,
|
||||
2.43615641, 12.92143144]]),
|
||||
),
|
||||
tuple(
|
||||
2248.0760851141,
|
||||
array([[-1.71755535, -5.59925137, 8.10545419, -4.03306318, -1.81098441,
|
||||
2.77407111, 32.28020575]]),
|
||||
),
|
||||
tuple(
|
||||
1663.3101472167,
|
||||
array([[-5.16785855, 2.7558756 , 8.10545419, -3.34620897, -1.74763642,
|
||||
2.42770463, 52.98214008]]),
|
||||
),
|
||||
tuple(
|
||||
1329.2703365134,
|
||||
array([[ -1.39600464, 9.69718343, -2.00394725, -2.59147366,
|
||||
-1.91246681, 2.07361175, 123.01833742]]),
|
||||
),
|
||||
tuple(
|
||||
355.7695549121,
|
||||
array([[ 9.76047401, 0.84696075, -2.00394725, -3.04310053,
|
||||
-1.99338573, 2.1185589 , 271.35743739]]),
|
||||
),
|
||||
])
|
||||
# ---
|
@ -0,0 +1,55 @@
|
||||
# serializer version: 1
|
||||
# name: test_log_spaced_fixed_orientation_mcmc_basic
|
||||
list([
|
||||
tuple(
|
||||
50.5632126772,
|
||||
array([[ 0. , 0. , 10. , -2.3960853 , 4.23246234,
|
||||
2.26169242, 39.39900844]]),
|
||||
),
|
||||
tuple(
|
||||
50.5632126772,
|
||||
array([[ 0. , 0. , 10. , -2.3960853 , 4.23246234,
|
||||
2.26169242, 39.39900844]]),
|
||||
),
|
||||
tuple(
|
||||
47.4038652151,
|
||||
array([[ 0. , 0. , 10. , -2.03666518, 4.14084039,
|
||||
2.21309317, 47.82371559]]),
|
||||
),
|
||||
tuple(
|
||||
47.4038652151,
|
||||
array([[ 0. , 0. , 10. , -2.03666518, 4.14084039,
|
||||
2.21309317, 47.82371559]]),
|
||||
),
|
||||
tuple(
|
||||
47.4038652151,
|
||||
array([[ 0. , 0. , 10. , -2.03666518, 4.14084039,
|
||||
2.21309317, 47.82371559]]),
|
||||
),
|
||||
tuple(
|
||||
47.4038652151,
|
||||
array([[ 0. , 0. , 10. , -2.03666518, 4.14084039,
|
||||
2.21309317, 47.82371559]]),
|
||||
),
|
||||
tuple(
|
||||
22.9304785991,
|
||||
array([[ 0. , 0. , 10. , -1.63019717, 3.97041764,
|
||||
2.53115835, 38.2051999 ]]),
|
||||
),
|
||||
tuple(
|
||||
28.8090658953,
|
||||
array([[ 0. , 0. , 10. , -1.14570315, 4.07709911,
|
||||
2.48697441, 49.58615195]]),
|
||||
),
|
||||
tuple(
|
||||
28.8090658953,
|
||||
array([[ 0. , 0. , 10. , -1.14570315, 4.07709911,
|
||||
2.48697441, 49.58615195]]),
|
||||
),
|
||||
tuple(
|
||||
40.9699102596,
|
||||
array([[ 0. , 0. , 10. , -0.50178755, 3.83878089,
|
||||
2.93560796, 82.07827571]]),
|
||||
),
|
||||
])
|
||||
# ---
|
@ -0,0 +1,31 @@
|
||||
# serializer version: 1
|
||||
# name: test_random_count_multiple_dipole_fixed_or_fixed_mag_model_get_n_dipoles
|
||||
list([
|
||||
list([
|
||||
list([
|
||||
10.0,
|
||||
0.0,
|
||||
6.123233995736766e-16,
|
||||
-2.3960852996076447,
|
||||
4.232462337639554,
|
||||
2.2616924238635443,
|
||||
39.399008444891905,
|
||||
]),
|
||||
]),
|
||||
])
|
||||
# ---
|
||||
# name: test_random_count_multiple_dipole_fixed_or_fixed_mag_model_get_n_dipoles.1
|
||||
list([
|
||||
list([
|
||||
list([
|
||||
10.0,
|
||||
0.0,
|
||||
6.123233995736766e-16,
|
||||
-2.3960852996076447,
|
||||
4.232462337639554,
|
||||
2.2616924238635443,
|
||||
39.399008444891905,
|
||||
]),
|
||||
]),
|
||||
])
|
||||
# ---
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user