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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyCosmoMMF
3
- Version: 0.0.7
3
+ Version: 0.0.8
4
4
  Summary: A package for detecting structures in the Cosmic Web.
5
5
  Home-page: https://github.com/James11222/PyCosmoMMF/
6
6
  Author: James Sunseri
@@ -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
- __version__ = '0.0.5'
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
- sigs[i,j,k,0] = (np.abs(e3 / e1) *
64
- np.abs(e3)) * (θ(-e1) * θ(-e2) * θ(-e3))
65
-
66
- sigs[i,j,k,1] = (np.abs(e2 / e1) *
67
- xθ(1-np.abs(e3 / e1))) * (np.abs(e2) * θ(-e1) * θ(-e2) )
68
-
69
- sigs[i,j,k,2] = (xθ(1-np.abs(e2 / e1)) *
70
- xθ(1-np.abs(e3 / e1))) * (np.abs(e1) * θ(-e1))
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyCosmoMMF
3
- Version: 0.0.7
3
+ Version: 0.0.8
4
4
  Summary: A package for detecting structures in the Cosmic Web.
5
5
  Home-page: https://github.com/James11222/PyCosmoMMF/
6
6
  Author: James Sunseri
@@ -12,7 +12,7 @@ here = pathlib.Path(__file__).parent.resolve()
12
12
 
13
13
  setup(
14
14
  name='PyCosmoMMF', # Required
15
- version='0.0.7', # Required
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