PyCosmoMMF 0.0.7__tar.gz → 0.0.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PKG-INFO +1 -1
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/__init__.py +8 -1
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/signatures.py +17 -11
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF.egg-info/PKG-INFO +1 -1
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/setup.py +1 -1
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/LICENSE +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/MANIFEST.in +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/filter.py +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/hessian.py +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/tagging.py +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/test_density_cube.npy +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF/utils.py +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF.egg-info/SOURCES.txt +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF.egg-info/dependency_links.txt +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/PyCosmoMMF.egg-info/top_level.txt +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/README.md +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/pyproject.toml +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/requirements.txt +0 -0
- {PyCosmoMMF-0.0.7 → PyCosmoMMF-0.0.8}/setup.cfg +0 -0
|
@@ -10,7 +10,14 @@ import pkg_resources
|
|
|
10
10
|
|
|
11
11
|
test_field = np.load(pkg_resources.resource_filename(__name__, 'test_density_cube.npy'))
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
def version():
|
|
14
|
+
"""
|
|
15
|
+
Print the version of the package.
|
|
16
|
+
"""
|
|
17
|
+
__version__ = '0.0.8'
|
|
18
|
+
|
|
19
|
+
print("PyCosmoMMF version: ", __version__)
|
|
20
|
+
|
|
14
21
|
|
|
15
22
|
|
|
16
23
|
|
|
@@ -59,20 +59,25 @@ def signatures_from_hessian(hessian):
|
|
|
59
59
|
])
|
|
60
60
|
|
|
61
61
|
e1, e2, e3 = np.sort(np.real(np.linalg.eigvals(hes_slice)))
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
|
|
63
|
+
if e1 == 0:
|
|
64
|
+
sigs[i,j,k,0] = 0
|
|
65
|
+
sigs[i,j,k,1] = 0
|
|
66
|
+
sigs[i,j,k,2] = 0
|
|
67
|
+
else:
|
|
68
|
+
sigs[i,j,k,0] = (np.abs(e3 / e1) *
|
|
69
|
+
np.abs(e3)) * (θ(-e1) * θ(-e2) * θ(-e3))
|
|
70
|
+
|
|
71
|
+
sigs[i,j,k,1] = (np.abs(e2 / e1) *
|
|
72
|
+
xθ(1-np.abs(e3 / e1))) * (np.abs(e2) * θ(-e1) * θ(-e2) )
|
|
73
|
+
|
|
74
|
+
sigs[i,j,k,2] = (xθ(1-np.abs(e2 / e1)) *
|
|
75
|
+
xθ(1-np.abs(e3 / e1))) * (np.abs(e1) * θ(-e1))
|
|
71
76
|
|
|
72
77
|
return sigs
|
|
73
78
|
|
|
74
79
|
|
|
75
|
-
def maximum_signature(Rs, field, alg='NEXUSPLUS'):
|
|
80
|
+
def maximum_signature(Rs, field, alg='NEXUSPLUS', eps=1e-8):
|
|
76
81
|
"""
|
|
77
82
|
Compute the maximum signatures across all scales Rs.
|
|
78
83
|
|
|
@@ -85,6 +90,8 @@ def maximum_signature(Rs, field, alg='NEXUSPLUS'):
|
|
|
85
90
|
alg : string, optional
|
|
86
91
|
The algorithm to use. Can be either 'NEXUS' or 'NEXUSPLUS'.
|
|
87
92
|
Default is 'NEXUSPLUS'.
|
|
93
|
+
eps : float, optional
|
|
94
|
+
A small number to avoid division by zero errors and whatnot. Default is 1e-8.
|
|
88
95
|
|
|
89
96
|
Returns
|
|
90
97
|
-------
|
|
@@ -95,7 +102,6 @@ def maximum_signature(Rs, field, alg='NEXUSPLUS'):
|
|
|
95
102
|
raise ValueError("alg must be either 'NEXUS' or 'NEXUSPLUS'")
|
|
96
103
|
|
|
97
104
|
nx, ny, nz = field.shape
|
|
98
|
-
eps = 1e-5
|
|
99
105
|
|
|
100
106
|
# Make sure the field has no 0 values
|
|
101
107
|
field = field + eps
|
|
@@ -12,7 +12,7 @@ here = pathlib.Path(__file__).parent.resolve()
|
|
|
12
12
|
|
|
13
13
|
setup(
|
|
14
14
|
name='PyCosmoMMF', # Required
|
|
15
|
-
version='0.0.
|
|
15
|
+
version='0.0.8', # Required
|
|
16
16
|
description='A package for detecting structures in the Cosmic Web.', # Optional
|
|
17
17
|
long_description=(here / 'README.md').read_text(encoding='utf-8'), # Optional
|
|
18
18
|
long_description_content_type='text/markdown', # Optional (see note above)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|