mesh2scattering 1.0.2__py3-none-any.whl → 1.0.4__py3-none-any.whl

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.
docs/api_reference.rst CHANGED
@@ -3,9 +3,13 @@
3
3
  API Reference
4
4
  =============
5
5
 
6
- The following gives detailed information about all mesh2scattering functions sorted
7
- according to their modules.
6
+ In a nutshell, Mesh2scattering consists of five modules:
8
7
 
8
+ - ``input``: prepares geometrical data and acoustic parameters for the simulation,
9
+ - ``numcalc``: based on the input from ``input``, it calculates the corresponding sound field
10
+ - ``output``: processes the output from NumCalc to scattering pattern.
11
+ - ``process``: processes the output to scattering and/or diffusion coefficients.
12
+ - ``utils``: helping functions.
9
13
 
10
14
  Modules
11
15
  -------
docs/index.rst CHANGED
@@ -12,7 +12,11 @@ mesh2scattering
12
12
  history
13
13
 
14
14
 
15
- Python Boilerplate contains all the boilerplate you need to create a Python package.
15
+ Numerical calculation of surface scattering.
16
+
17
+ Mesh2scattering is based on https://github.com/Any2HRTF/Mesh2HRTF and is an open-source project aiming an easy-to-use software package for the numerical calculation of scattering pattern and scattering and diffusion coefficients of any surface.
18
+ Please notice that this project does not support HRTF post processing, use https://github.com/Any2HRTF/Mesh2HRTF instead.
19
+
16
20
 
17
21
  .. grid:: 1 2 2 2
18
22
  :gutter: 4
@@ -4,7 +4,7 @@
4
4
 
5
5
  __author__ = """The Mesh2hrtf and mesh2scattering developers"""
6
6
  __email__ = ''
7
- __version__ = '1.0.2'
7
+ __version__ = '1.0.4'
8
8
 
9
9
  from . import input # noqa: A004
10
10
  from . import numcalc
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: mesh2scattering
3
+ Version: 1.0.4
4
+ Summary: Numerical calculation of surface scattering.
5
+ License-Expression: MIT
6
+ Project-URL: Tracker, https://github.com/ahms5/mesh2scattering/issues
7
+ Project-URL: Documentation, https://mesh2scattering.readthedocs.io/
8
+ Project-URL: Download, https://pypi.org/project/mesh2scattering/
9
+ Project-URL: Source, https://github.com/ahms5/mesh2scattering
10
+ Project-URL: Changelog, https://github.com/ahms5/mesh2scattering/blob/master/CHANGELOG.md
11
+ Keywords: acoustics,pyfar
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: numpy>=1.14.0
25
+ Requires-Dist: scipy>=1.5.0
26
+ Requires-Dist: matplotlib
27
+ Requires-Dist: pyfar<0.8.0
28
+ Requires-Dist: psutil
29
+ Requires-Dist: sofar
30
+ Requires-Dist: netCDF4!=1.7.4
31
+ Requires-Dist: trimesh
32
+ Requires-Dist: pooch
33
+ Provides-Extra: deploy
34
+ Requires-Dist: twine; extra == "deploy"
35
+ Requires-Dist: wheel; extra == "deploy"
36
+ Requires-Dist: build; extra == "deploy"
37
+ Requires-Dist: setuptools; extra == "deploy"
38
+ Requires-Dist: bump-my-version; extra == "deploy"
39
+ Provides-Extra: tests
40
+ Requires-Dist: pytest; extra == "tests"
41
+ Requires-Dist: pytest-cov; extra == "tests"
42
+ Requires-Dist: watchdog; extra == "tests"
43
+ Requires-Dist: ruff==0.9.8; extra == "tests"
44
+ Requires-Dist: coverage; extra == "tests"
45
+ Requires-Dist: nbmake>=0.7.0; extra == "tests"
46
+ Provides-Extra: docs
47
+ Requires-Dist: sphinx; extra == "docs"
48
+ Requires-Dist: autodocsumm>=0.2.14; extra == "docs"
49
+ Requires-Dist: pydata-sphinx-theme; extra == "docs"
50
+ Requires-Dist: sphinx_mdinclude; extra == "docs"
51
+ Requires-Dist: sphinx-design; extra == "docs"
52
+ Requires-Dist: sphinx-favicon; extra == "docs"
53
+ Requires-Dist: sphinx-reredirects; extra == "docs"
54
+ Requires-Dist: nbsphinx; extra == "docs"
55
+ Requires-Dist: sphinx_gallery; extra == "docs"
56
+ Requires-Dist: nbsphinx_link; extra == "docs"
57
+ Requires-Dist: ipython; extra == "docs"
58
+ Provides-Extra: dev
59
+ Requires-Dist: mesh2scattering[deploy,docs,tests]; extra == "dev"
60
+
61
+ # Mesh2scattering
62
+
63
+ [![PyPI version](https://badge.fury.io/py/mesh2scattering.svg)](https://badge.fury.io/py/mesh2scattering)
64
+ [![Documentation Status](https://readthedocs.org/projects/mesh2scattering/badge/?version=latest)](https://mesh2scattering.readthedocs.io/en/latest/?badge=latest)
65
+ [![CircleCI](https://circleci.com/gh/ahms5/mesh2scattering.svg?style=shield)](https://circleci.com/gh/ahms5/mesh2scattering)
66
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)
67
+
68
+ Mesh2scattering is based on [Mesh2HRTF](https://github.com/Any2HRTF/Mesh2HRTF) and is an open-source project aiming an easy-to-use software package for the numerical calculation of scattering pattern and scattering and diffusion coefficients of any surface. In a nutshell, Mesh2scattering consists of five parts:
69
+
70
+ - input: prepares geometrical data and acoustic parameters for the simulation,
71
+ - numcalc: based on the input from ``input``, it calculates the corresponding sound field
72
+ - output: processes the output from NumCalc to scattering pattern.
73
+ - process: processes the output to scattering and/or diffusion coefficients.
74
+ - utils: helping functions.
75
+
76
+ Please notice that this project does not support HRTF post processing, use [Mesh2HRTF](https://github.com/Any2HRTF/Mesh2HRTF) instead.
77
+
78
+ ## Getting Started
79
+
80
+ Check out the examples folder for a tour of the most important mesh2scattering
81
+ functionality and [read the docs](https://mesh2scattering.readthedocs.io/en/latest) for the complete documentation.
82
+
83
+ ## Installation
84
+
85
+ Use pip to install mesh2scattering
86
+
87
+ ```bash
88
+ pip install mesh2scattering
89
+ ```
90
+
91
+ (Requires Python 3.9 or higher)
92
+
93
+ For Windows the exe is downloaded automatically.
94
+ For Linux and MacOS NumCalc is build automatically, note that this requires
95
+ the ``build-essential`` on Linux and ``xcode`` on mac.
96
+ In the [contributing guidelines](https://mesh2scattering.readthedocs.io/en/stable/contributing.html), you will find a complete Instructions for
97
+ manual building.
98
+
99
+ ## Contributing
100
+
101
+ Check out the [contributing guidelines](https://mesh2scattering.readthedocs.io/en/stable/contributing.html).
@@ -1,10 +1,10 @@
1
1
  docs/Makefile,sha256=xef7kOYMgSa2ZahmHhoLuHtHWY7GsM5eCAXoXizIUOw,616
2
- docs/api_reference.rst,sha256=x9ESdFnYsKaDuAJ-2g7EwB3gtAdMG2oBw-mNb_LVwVo,380
2
+ docs/api_reference.rst,sha256=lvUJyNiKQeB-2q6U2CijF-cPzPBJ7QN8G7swQoyN0K0,686
3
3
  docs/conf.py,sha256=LZdmoOvXVAFYZk7GRKxBSnq-qp02NMrmmQKlfQg-A0I,5414
4
4
  docs/contributing.rst,sha256=h9XHQ0lx_ySKgXQmwqhJQLPD7VElHdyu1ruKfYWvrYA,33
5
5
  docs/examples.rst,sha256=BCVFdoY6R5G7N8MLlo5uxipLfp9sc_qdwB6py-aS43o,67
6
6
  docs/history.rst,sha256=KNgUl0d77zXZj8f-7m-tBzqgMaQLhr-9_EwdLhVBjAQ,31
7
- docs/index.rst,sha256=e34Aev2yy8sZ0vbPakazz-3byRPpzPlEX9uzBcj0Eqg,1451
7
+ docs/index.rst,sha256=7ChZWUhFqj2OKd9EWTxEJIPSt8-hW0wCO4wQdSdir9Y,1781
8
8
  docs/make.bat,sha256=FlHW4Ipd9i-vjYw1ifk_N7Iv3A-ACu1FdhtrrhwNjCM,813
9
9
  docs/readme.rst,sha256=ctYl-VOckbYAd-QhoWKIKS2C1kErl9plJWaPraZkfjY,28
10
10
  docs/modules/mesh2scattering.input.rst,sha256=gIr2gXBoj2dEynzE3iovRLKv_Etnphi9c8iiRX_H3mk,528
@@ -12,7 +12,7 @@ docs/modules/mesh2scattering.numcalc.rst,sha256=676UPO2O2nO2oSImY5po_2jrbYAUH4bq
12
12
  docs/modules/mesh2scattering.output.rst,sha256=VzyrWMZk1SoBV11HXhNDjTBRyC3fcaSo3Lmt75k4-_Q,140
13
13
  docs/modules/mesh2scattering.process.rst,sha256=ne4crcT4NZZhIO5aXIWTsTSM3f5XwfBX10EHBpiXCdI,143
14
14
  docs/modules/mesh2scattering.utils.rst,sha256=zN26BgdpzYKISwAdg44RpEp_mxv4IdH3qkSjgMsN1VI,137
15
- mesh2scattering/__init__.py,sha256=2F08K91NaOyFlz1jBv1uP9WzG9pFBL1XBarF7_xAnpQ,381
15
+ mesh2scattering/__init__.py,sha256=S3S7VEGFylhbVKyaN2hrB-mMUC46jkOT0-5LhX7I0U4,381
16
16
  mesh2scattering/input/EvaluationGrid.py,sha256=d3BvOeb-vjld35JivIRznw0hpSILVqlpxabaaCSaffc,7082
17
17
  mesh2scattering/input/SampleMesh.py,sha256=ucICiLENXMHg2qvqXeIy6WeDQ_h26um0A4LN14eRypU,14451
18
18
  mesh2scattering/input/SoundSource.py,sha256=87DZiBhLOwnNYK-ycQ4WTtOLF9AK3hbO7qAunzUWUPU,2901
@@ -41,7 +41,6 @@ mesh2scattering/process/coefficients.py,sha256=WD2MO6AhCzp9rxMAAz56cJMiLcRHEoCng
41
41
  mesh2scattering/process/process.py,sha256=o23GNASEqS57sG9TEw54G-A66Al95dRdTTzMnW4mFO8,1802
42
42
  mesh2scattering/utils/__init__.py,sha256=1RdAWr0Rn4EEEVqNbc0mdGs5kpscpNeqbBnHXJ1mFz8,198
43
43
  mesh2scattering/utils/utils.py,sha256=qhRrQKTRAluVz7xLKmN7hXmXub1kTETAmv1qZsGdFP8,1033
44
- mesh2scattering-1.0.2.dist-info/licenses/LICENSE.txt,sha256=b8nnCcy_4Nd_v_okJ6mDKCvi64jkexzbSfIag7TR5mU,13827
45
44
  tests/conftest.py,sha256=2dn_V8z4kOEuAeSZRNrJqrJsQLXAlOV_w5XNFXk9U4c,281
46
45
  tests/test_input.py,sha256=leg1h_t2KvsPAmzxLG9nGy_bzFxQ1kcLyrZvw85qSVA,12911
47
46
  tests/test_input_EvaluationGrid.py,sha256=gPfr6aJ17S4SzUPC9F1JZ8TTZOSDCVLNfOX-sb966QE,4961
@@ -53,7 +52,6 @@ tests/test_output.py,sha256=Au-qCPPN-pWs7xObs7UnBaZb4H76nJDqLu8G_yjtZmo,3789
53
52
  tests/test_process.py,sha256=fmpLTWavvSp1jtokKGW95emBJomUr3SWoUZKAerP-Ro,2044
54
53
  tests/test_scattering.py,sha256=h31UHVpInampAm9CHITtAJMu9WHqVorEIlWMVh6SbDk,6511
55
54
  tests/test_utils.py,sha256=lVBWls61Mvw6FyT5qlATbaoonZ62P66ER5NBQFecwI8,76
56
- tests/test_write_read_projects.py,sha256=MeGF9BApcJdPXfQgcWWX2HKHTTbvJnCdJgfXRYJsLm4,4291
57
55
  tests/references/Grid/Elements.txt,sha256=h_yY3H2X7L9ZGox-rWfCnuypbJIC9sGkUFCLPZCL5zI,1724468
58
56
  tests/references/Grid/Nodes.txt,sha256=L6TCcUmG5qDqrTUIeiiYt5iByU13gS5OcSWXJo1GlSw,1884359
59
57
  tests/references/Grid/sample.stl,sha256=QSH-Yh3AD9D_ahmefi_NlFghGvpkv5GvWA8pPHT0Kis,15449746
@@ -195,7 +193,7 @@ tests/resources/output/sine/NumCalc/source_2/be.out/be.2/vEvalGrid,sha256=Fv4ODE
195
193
  tests/resources/output/sine/ObjectMeshes/Reference.stl,sha256=z7-vISF_ram6YWmyGJ58lL4RUBs4GE1ZQfw5tMchNgY,929384
196
194
  tests/resources/output/sine/ObjectMeshes/Reference/Elements.txt,sha256=ak-jLbLwHpOUBuD70Jx2TyCfidkqgAgCgKx3rj8XyqA,484064
197
195
  tests/resources/output/sine/ObjectMeshes/Reference/Nodes.txt,sha256=3yDV1c0V1V0w2wm-lf3nPWylrP4akJkt3lFERtg_OqU,580895
198
- mesh2scattering-1.0.2.dist-info/METADATA,sha256=LJy2XW0FV83wmJsxyp59m8EikQsF5Nox6nlbZ_xz2xI,20730
199
- mesh2scattering-1.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
200
- mesh2scattering-1.0.2.dist-info/top_level.txt,sha256=mCRW5JG0xphV_NzdtfY_9uc8EMMsmIcCUpXS01gwGik,27
201
- mesh2scattering-1.0.2.dist-info/RECORD,,
196
+ mesh2scattering-1.0.4.dist-info/METADATA,sha256=LfRXmsESnElByDFwV9XHAOtVQ9kN_iU0SMuhqQCfZjM,4602
197
+ mesh2scattering-1.0.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
198
+ mesh2scattering-1.0.4.dist-info/top_level.txt,sha256=mCRW5JG0xphV_NzdtfY_9uc8EMMsmIcCUpXS01gwGik,27
199
+ mesh2scattering-1.0.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,389 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mesh2scattering
3
- Version: 1.0.2
4
- Summary: Numerical calculation of surface scattering.
5
- License: EUROPEAN UNION PUBLIC LICENCE v. 1.2
6
- EUPL © the European Union 2007, 2016
7
-
8
- This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
9
- below) which is provided under the terms of this Licence. Any use of the Work,
10
- other than as authorised under this Licence is prohibited (to the extent such
11
- use is covered by a right of the copyright holder of the Work).
12
-
13
- The Work is provided under the terms of this Licence when the Licensor (as
14
- defined below) has placed the following notice immediately following the
15
- copyright notice for the Work:
16
-
17
- Licensed under the EUPL
18
-
19
- or has expressed by any other means his willingness to license under the EUPL.
20
-
21
- 1. Definitions
22
-
23
- In this Licence, the following terms have the following meaning:
24
-
25
- - ‘The Licence’: this Licence.
26
-
27
- - ‘The Original Work’: the work or software distributed or communicated by the
28
- Licensor under this Licence, available as Source Code and also as Executable
29
- Code as the case may be.
30
-
31
- - ‘Derivative Works’: the works or software that could be created by the
32
- Licensee, based upon the Original Work or modifications thereof. This Licence
33
- does not define the extent of modification or dependence on the Original Work
34
- required in order to classify a work as a Derivative Work; this extent is
35
- determined by copyright law applicable in the country mentioned in Article 15.
36
-
37
- - ‘The Work’: the Original Work or its Derivative Works.
38
-
39
- - ‘The Source Code’: the human-readable form of the Work which is the most
40
- convenient for people to study and modify.
41
-
42
- - ‘The Executable Code’: any code which has generally been compiled and which is
43
- meant to be interpreted by a computer as a program.
44
-
45
- - ‘The Licensor’: the natural or legal person that distributes or communicates
46
- the Work under the Licence.
47
-
48
- - ‘Contributor(s)’: any natural or legal person who modifies the Work under the
49
- Licence, or otherwise contributes to the creation of a Derivative Work.
50
-
51
- - ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
52
- the Work under the terms of the Licence.
53
-
54
- - ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
55
- renting, distributing, communicating, transmitting, or otherwise making
56
- available, online or offline, copies of the Work or providing access to its
57
- essential functionalities at the disposal of any other natural or legal
58
- person.
59
-
60
- 2. Scope of the rights granted by the Licence
61
-
62
- The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
63
- sublicensable licence to do the following, for the duration of copyright vested
64
- in the Original Work:
65
-
66
- - use the Work in any circumstance and for all usage,
67
- - reproduce the Work,
68
- - modify the Work, and make Derivative Works based upon the Work,
69
- - communicate to the public, including the right to make available or display
70
- the Work or copies thereof to the public and perform publicly, as the case may
71
- be, the Work,
72
- - distribute the Work or copies thereof,
73
- - lend and rent the Work or copies thereof,
74
- - sublicense rights in the Work or copies thereof.
75
-
76
- Those rights can be exercised on any media, supports and formats, whether now
77
- known or later invented, as far as the applicable law permits so.
78
-
79
- In the countries where moral rights apply, the Licensor waives his right to
80
- exercise his moral right to the extent allowed by law in order to make effective
81
- the licence of the economic rights here above listed.
82
-
83
- The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
84
- any patents held by the Licensor, to the extent necessary to make use of the
85
- rights granted on the Work under this Licence.
86
-
87
- 3. Communication of the Source Code
88
-
89
- The Licensor may provide the Work either in its Source Code form, or as
90
- Executable Code. If the Work is provided as Executable Code, the Licensor
91
- provides in addition a machine-readable copy of the Source Code of the Work
92
- along with each copy of the Work that the Licensor distributes or indicates, in
93
- a notice following the copyright notice attached to the Work, a repository where
94
- the Source Code is easily and freely accessible for as long as the Licensor
95
- continues to distribute or communicate the Work.
96
-
97
- 4. Limitations on copyright
98
-
99
- Nothing in this Licence is intended to deprive the Licensee of the benefits from
100
- any exception or limitation to the exclusive rights of the rights owners in the
101
- Work, of the exhaustion of those rights or of other applicable limitations
102
- thereto.
103
-
104
- 5. Obligations of the Licensee
105
-
106
- The grant of the rights mentioned above is subject to some restrictions and
107
- obligations imposed on the Licensee. Those obligations are the following:
108
-
109
- Attribution right: The Licensee shall keep intact all copyright, patent or
110
- trademarks notices and all notices that refer to the Licence and to the
111
- disclaimer of warranties. The Licensee must include a copy of such notices and a
112
- copy of the Licence with every copy of the Work he/she distributes or
113
- communicates. The Licensee must cause any Derivative Work to carry prominent
114
- notices stating that the Work has been modified and the date of modification.
115
-
116
- Copyleft clause: If the Licensee distributes or communicates copies of the
117
- Original Works or Derivative Works, this Distribution or Communication will be
118
- done under the terms of this Licence or of a later version of this Licence
119
- unless the Original Work is expressly distributed only under this version of the
120
- Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
121
- (becoming Licensor) cannot offer or impose any additional terms or conditions on
122
- the Work or Derivative Work that alter or restrict the terms of the Licence.
123
-
124
- Compatibility clause: If the Licensee Distributes or Communicates Derivative
125
- Works or copies thereof based upon both the Work and another work licensed under
126
- a Compatible Licence, this Distribution or Communication can be done under the
127
- terms of this Compatible Licence. For the sake of this clause, ‘Compatible
128
- Licence’ refers to the licences listed in the appendix attached to this Licence.
129
- Should the Licensee's obligations under the Compatible Licence conflict with
130
- his/her obligations under this Licence, the obligations of the Compatible
131
- Licence shall prevail.
132
-
133
- Provision of Source Code: When distributing or communicating copies of the Work,
134
- the Licensee will provide a machine-readable copy of the Source Code or indicate
135
- a repository where this Source will be easily and freely available for as long
136
- as the Licensee continues to distribute or communicate the Work.
137
-
138
- Legal Protection: This Licence does not grant permission to use the trade names,
139
- trademarks, service marks, or names of the Licensor, except as required for
140
- reasonable and customary use in describing the origin of the Work and
141
- reproducing the content of the copyright notice.
142
-
143
- 6. Chain of Authorship
144
-
145
- The original Licensor warrants that the copyright in the Original Work granted
146
- hereunder is owned by him/her or licensed to him/her and that he/she has the
147
- power and authority to grant the Licence.
148
-
149
- Each Contributor warrants that the copyright in the modifications he/she brings
150
- to the Work are owned by him/her or licensed to him/her and that he/she has the
151
- power and authority to grant the Licence.
152
-
153
- Each time You accept the Licence, the original Licensor and subsequent
154
- Contributors grant You a licence to their contributions to the Work, under the
155
- terms of this Licence.
156
-
157
- 7. Disclaimer of Warranty
158
-
159
- The Work is a work in progress, which is continuously improved by numerous
160
- Contributors. It is not a finished work and may therefore contain defects or
161
- ‘bugs’ inherent to this type of development.
162
-
163
- For the above reason, the Work is provided under the Licence on an ‘as is’ basis
164
- and without warranties of any kind concerning the Work, including without
165
- limitation merchantability, fitness for a particular purpose, absence of defects
166
- or errors, accuracy, non-infringement of intellectual property rights other than
167
- copyright as stated in Article 6 of this Licence.
168
-
169
- This disclaimer of warranty is an essential part of the Licence and a condition
170
- for the grant of any rights to the Work.
171
-
172
- 8. Disclaimer of Liability
173
-
174
- Except in the cases of wilful misconduct or damages directly caused to natural
175
- persons, the Licensor will in no event be liable for any direct or indirect,
176
- material or moral, damages of any kind, arising out of the Licence or of the use
177
- of the Work, including without limitation, damages for loss of goodwill, work
178
- stoppage, computer failure or malfunction, loss of data or any commercial
179
- damage, even if the Licensor has been advised of the possibility of such damage.
180
- However, the Licensor will be liable under statutory product liability laws as
181
- far such laws apply to the Work.
182
-
183
- 9. Additional agreements
184
-
185
- While distributing the Work, You may choose to conclude an additional agreement,
186
- defining obligations or services consistent with this Licence. However, if
187
- accepting obligations, You may act only on your own behalf and on your sole
188
- responsibility, not on behalf of the original Licensor or any other Contributor,
189
- and only if You agree to indemnify, defend, and hold each Contributor harmless
190
- for any liability incurred by, or claims asserted against such Contributor by
191
- the fact You have accepted any warranty or additional liability.
192
-
193
- 10. Acceptance of the Licence
194
-
195
- The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
196
- placed under the bottom of a window displaying the text of this Licence or by
197
- affirming consent in any other similar way, in accordance with the rules of
198
- applicable law. Clicking on that icon indicates your clear and irrevocable
199
- acceptance of this Licence and all of its terms and conditions.
200
-
201
- Similarly, you irrevocably accept this Licence and all of its terms and
202
- conditions by exercising any rights granted to You by Article 2 of this Licence,
203
- such as the use of the Work, the creation by You of a Derivative Work or the
204
- Distribution or Communication by You of the Work or copies thereof.
205
-
206
- 11. Information to the public
207
-
208
- In case of any Distribution or Communication of the Work by means of electronic
209
- communication by You (for example, by offering to download the Work from a
210
- remote location) the distribution channel or media (for example, a website) must
211
- at least provide to the public the information requested by the applicable law
212
- regarding the Licensor, the Licence and the way it may be accessible, concluded,
213
- stored and reproduced by the Licensee.
214
-
215
- 12. Termination of the Licence
216
-
217
- The Licence and the rights granted hereunder will terminate automatically upon
218
- any breach by the Licensee of the terms of the Licence.
219
-
220
- Such a termination will not terminate the licences of any person who has
221
- received the Work from the Licensee under the Licence, provided such persons
222
- remain in full compliance with the Licence.
223
-
224
- 13. Miscellaneous
225
-
226
- Without prejudice of Article 9 above, the Licence represents the complete
227
- agreement between the Parties as to the Work.
228
-
229
- If any provision of the Licence is invalid or unenforceable under applicable
230
- law, this will not affect the validity or enforceability of the Licence as a
231
- whole. Such provision will be construed or reformed so as necessary to make it
232
- valid and enforceable.
233
-
234
- The European Commission may publish other linguistic versions or new versions of
235
- this Licence or updated versions of the Appendix, so far this is required and
236
- reasonable, without reducing the scope of the rights granted by the Licence. New
237
- versions of the Licence will be published with a unique version number.
238
-
239
- All linguistic versions of this Licence, approved by the European Commission,
240
- have identical value. Parties can take advantage of the linguistic version of
241
- their choice.
242
-
243
- 14. Jurisdiction
244
-
245
- Without prejudice to specific agreement between parties,
246
-
247
- - any litigation resulting from the interpretation of this License, arising
248
- between the European Union institutions, bodies, offices or agencies, as a
249
- Licensor, and any Licensee, will be subject to the jurisdiction of the Court
250
- of Justice of the European Union, as laid down in article 272 of the Treaty on
251
- the Functioning of the European Union,
252
-
253
- - any litigation arising between other parties and resulting from the
254
- interpretation of this License, will be subject to the exclusive jurisdiction
255
- of the competent court where the Licensor resides or conducts its primary
256
- business.
257
-
258
- 15. Applicable Law
259
-
260
- Without prejudice to specific agreement between parties,
261
-
262
- - this Licence shall be governed by the law of the European Union Member State
263
- where the Licensor has his seat, resides or has his registered office,
264
-
265
- - this licence shall be governed by Belgian law if the Licensor has no seat,
266
- residence or registered office inside a European Union Member State.
267
-
268
- Appendix
269
-
270
- ‘Compatible Licences’ according to Article 5 EUPL are:
271
-
272
- - GNU General Public License (GPL) v. 2, v. 3
273
- - GNU Affero General Public License (AGPL) v. 3
274
- - Open Software License (OSL) v. 2.1, v. 3.0
275
- - Eclipse Public License (EPL) v. 1.0
276
- - CeCILL v. 2.0, v. 2.1
277
- - Mozilla Public Licence (MPL) v. 2
278
- - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
279
- - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
280
- works other than software
281
- - European Union Public Licence (EUPL) v. 1.1, v. 1.2
282
- - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
283
- Reciprocity (LiLiQ-R+).
284
-
285
- The European Commission may update this Appendix to later versions of the above
286
- licences without producing a new version of the EUPL, as long as they provide
287
- the rights granted in Article 2 of this Licence and protect the covered Source
288
- Code from exclusive appropriation.
289
-
290
- All other changes or additions to this Appendix require the production of a new
291
- EUPL version.
292
-
293
- Project-URL: Tracker, https://github.com/ahms5/mesh2scattering/issues
294
- Project-URL: Documentation, https://mesh2scattering.readthedocs.io/
295
- Project-URL: Download, https://pypi.org/project/mesh2scattering/
296
- Project-URL: Source, https://github.com/ahms5/mesh2scattering
297
- Project-URL: Changelog, https://github.com/ahms5/mesh2scattering/blob/master/CHANGELOG.md
298
- Keywords: acoustics,pyfar
299
- Classifier: Development Status :: 4 - Beta
300
- Classifier: Intended Audience :: Science/Research
301
- Classifier: License :: OSI Approved :: MIT License
302
- Classifier: Natural Language :: English
303
- Classifier: Programming Language :: Python :: 3
304
- Classifier: Programming Language :: Python :: 3.9
305
- Classifier: Programming Language :: Python :: 3.10
306
- Classifier: Programming Language :: Python :: 3.11
307
- Classifier: Programming Language :: Python :: 3.12
308
- Classifier: Programming Language :: Python :: 3.13
309
- Requires-Python: >=3.9
310
- Description-Content-Type: text/markdown
311
- License-File: LICENSE.txt
312
- Requires-Dist: numpy>=1.14.0
313
- Requires-Dist: scipy>=1.5.0
314
- Requires-Dist: matplotlib
315
- Requires-Dist: pyfar<0.8.0
316
- Requires-Dist: psutil
317
- Requires-Dist: sofar
318
- Requires-Dist: trimesh
319
- Requires-Dist: pooch
320
- Provides-Extra: deploy
321
- Requires-Dist: twine; extra == "deploy"
322
- Requires-Dist: wheel; extra == "deploy"
323
- Requires-Dist: build; extra == "deploy"
324
- Requires-Dist: setuptools; extra == "deploy"
325
- Requires-Dist: bump-my-version; extra == "deploy"
326
- Provides-Extra: tests
327
- Requires-Dist: pytest; extra == "tests"
328
- Requires-Dist: pytest-cov; extra == "tests"
329
- Requires-Dist: watchdog; extra == "tests"
330
- Requires-Dist: ruff==0.9.8; extra == "tests"
331
- Requires-Dist: coverage; extra == "tests"
332
- Requires-Dist: nbmake>=0.7.0; extra == "tests"
333
- Provides-Extra: docs
334
- Requires-Dist: sphinx; extra == "docs"
335
- Requires-Dist: autodocsumm>=0.2.14; extra == "docs"
336
- Requires-Dist: pydata-sphinx-theme; extra == "docs"
337
- Requires-Dist: sphinx_mdinclude; extra == "docs"
338
- Requires-Dist: sphinx-design; extra == "docs"
339
- Requires-Dist: sphinx-favicon; extra == "docs"
340
- Requires-Dist: sphinx-reredirects; extra == "docs"
341
- Requires-Dist: nbsphinx; extra == "docs"
342
- Requires-Dist: sphinx_gallery; extra == "docs"
343
- Requires-Dist: nbsphinx_link; extra == "docs"
344
- Requires-Dist: ipython; extra == "docs"
345
- Provides-Extra: dev
346
- Requires-Dist: mesh2scattering[deploy,docs,tests]; extra == "dev"
347
- Dynamic: license-file
348
-
349
- # Mesh2scattering
350
-
351
- [![PyPI version](https://badge.fury.io/py/mesh2scattering.svg)](https://badge.fury.io/py/mesh2scattering)
352
- [![Documentation Status](https://readthedocs.org/projects/mesh2scattering/badge/?version=latest)](https://mesh2scattering.readthedocs.io/en/latest/?badge=latest)
353
- [![CircleCI](https://circleci.com/gh/ahms5/mesh2scattering.svg?style=shield)](https://circleci.com/gh/ahms5/mesh2scattering)
354
- [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)
355
-
356
- Mesh2scattering is based on [Mesh2HRTF](https://github.com/Any2HRTF/Mesh2HRTF) and is an open-source project aiming an easy-to-use software package for the numerical calculation of scattering pattern and scattering and diffusion coefficients of any surface. In a nutshell, Mesh2scattering consists of three parts:
357
-
358
- - input: prepares geometrical data and acoustic parameters for the simulation,
359
- - numcalc: based on the input from ``input``, it calculates the corresponding sound field
360
- - output: processes the output from NumCalc to scattering pattern.
361
- - process: processes the output to scattering and/or diffusion coefficients.
362
- - utils: helping functions.
363
-
364
- Please notice that this project does not support HRTF post processing, use [Mesh2HRTF](https://github.com/Any2HRTF/Mesh2HRTF) instead.
365
-
366
- ## Getting Started
367
-
368
- Check out the examples folder for a tour of the most important mesh2scattering
369
- functionality and [read the docs](https://mesh2scattering.readthedocs.io/en/latest) for the complete documentation.
370
-
371
- ## Installation
372
-
373
- Use pip to install mesh2scattering
374
-
375
- ```bash
376
- pip install mesh2scattering
377
- ```
378
-
379
- (Requires Python 3.9 or higher)
380
-
381
- For Windows the exe is downloaded automatically.
382
- For Linux and MacOS NumCalc is build automatically, note that this requires
383
- the ``build-essential`` on Linux and ``xcode`` on mac.
384
- In the [contributing guidelines](https://mesh2scattering.readthedocs.io/en/stable/contributing.html), you will find a complete Instructions for
385
- manual building.
386
-
387
- ## Contributing
388
-
389
- Check out the [contributing guidelines](https://mesh2scattering.readthedocs.io/en/stable/contributing.html).
@@ -1,287 +0,0 @@
1
- EUROPEAN UNION PUBLIC LICENCE v. 1.2
2
- EUPL © the European Union 2007, 2016
3
-
4
- This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined
5
- below) which is provided under the terms of this Licence. Any use of the Work,
6
- other than as authorised under this Licence is prohibited (to the extent such
7
- use is covered by a right of the copyright holder of the Work).
8
-
9
- The Work is provided under the terms of this Licence when the Licensor (as
10
- defined below) has placed the following notice immediately following the
11
- copyright notice for the Work:
12
-
13
- Licensed under the EUPL
14
-
15
- or has expressed by any other means his willingness to license under the EUPL.
16
-
17
- 1. Definitions
18
-
19
- In this Licence, the following terms have the following meaning:
20
-
21
- - ‘The Licence’: this Licence.
22
-
23
- - ‘The Original Work’: the work or software distributed or communicated by the
24
- Licensor under this Licence, available as Source Code and also as Executable
25
- Code as the case may be.
26
-
27
- - ‘Derivative Works’: the works or software that could be created by the
28
- Licensee, based upon the Original Work or modifications thereof. This Licence
29
- does not define the extent of modification or dependence on the Original Work
30
- required in order to classify a work as a Derivative Work; this extent is
31
- determined by copyright law applicable in the country mentioned in Article 15.
32
-
33
- - ‘The Work’: the Original Work or its Derivative Works.
34
-
35
- - ‘The Source Code’: the human-readable form of the Work which is the most
36
- convenient for people to study and modify.
37
-
38
- - ‘The Executable Code’: any code which has generally been compiled and which is
39
- meant to be interpreted by a computer as a program.
40
-
41
- - ‘The Licensor’: the natural or legal person that distributes or communicates
42
- the Work under the Licence.
43
-
44
- - ‘Contributor(s)’: any natural or legal person who modifies the Work under the
45
- Licence, or otherwise contributes to the creation of a Derivative Work.
46
-
47
- - ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of
48
- the Work under the terms of the Licence.
49
-
50
- - ‘Distribution’ or ‘Communication’: any act of selling, giving, lending,
51
- renting, distributing, communicating, transmitting, or otherwise making
52
- available, online or offline, copies of the Work or providing access to its
53
- essential functionalities at the disposal of any other natural or legal
54
- person.
55
-
56
- 2. Scope of the rights granted by the Licence
57
-
58
- The Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
59
- sublicensable licence to do the following, for the duration of copyright vested
60
- in the Original Work:
61
-
62
- - use the Work in any circumstance and for all usage,
63
- - reproduce the Work,
64
- - modify the Work, and make Derivative Works based upon the Work,
65
- - communicate to the public, including the right to make available or display
66
- the Work or copies thereof to the public and perform publicly, as the case may
67
- be, the Work,
68
- - distribute the Work or copies thereof,
69
- - lend and rent the Work or copies thereof,
70
- - sublicense rights in the Work or copies thereof.
71
-
72
- Those rights can be exercised on any media, supports and formats, whether now
73
- known or later invented, as far as the applicable law permits so.
74
-
75
- In the countries where moral rights apply, the Licensor waives his right to
76
- exercise his moral right to the extent allowed by law in order to make effective
77
- the licence of the economic rights here above listed.
78
-
79
- The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to
80
- any patents held by the Licensor, to the extent necessary to make use of the
81
- rights granted on the Work under this Licence.
82
-
83
- 3. Communication of the Source Code
84
-
85
- The Licensor may provide the Work either in its Source Code form, or as
86
- Executable Code. If the Work is provided as Executable Code, the Licensor
87
- provides in addition a machine-readable copy of the Source Code of the Work
88
- along with each copy of the Work that the Licensor distributes or indicates, in
89
- a notice following the copyright notice attached to the Work, a repository where
90
- the Source Code is easily and freely accessible for as long as the Licensor
91
- continues to distribute or communicate the Work.
92
-
93
- 4. Limitations on copyright
94
-
95
- Nothing in this Licence is intended to deprive the Licensee of the benefits from
96
- any exception or limitation to the exclusive rights of the rights owners in the
97
- Work, of the exhaustion of those rights or of other applicable limitations
98
- thereto.
99
-
100
- 5. Obligations of the Licensee
101
-
102
- The grant of the rights mentioned above is subject to some restrictions and
103
- obligations imposed on the Licensee. Those obligations are the following:
104
-
105
- Attribution right: The Licensee shall keep intact all copyright, patent or
106
- trademarks notices and all notices that refer to the Licence and to the
107
- disclaimer of warranties. The Licensee must include a copy of such notices and a
108
- copy of the Licence with every copy of the Work he/she distributes or
109
- communicates. The Licensee must cause any Derivative Work to carry prominent
110
- notices stating that the Work has been modified and the date of modification.
111
-
112
- Copyleft clause: If the Licensee distributes or communicates copies of the
113
- Original Works or Derivative Works, this Distribution or Communication will be
114
- done under the terms of this Licence or of a later version of this Licence
115
- unless the Original Work is expressly distributed only under this version of the
116
- Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee
117
- (becoming Licensor) cannot offer or impose any additional terms or conditions on
118
- the Work or Derivative Work that alter or restrict the terms of the Licence.
119
-
120
- Compatibility clause: If the Licensee Distributes or Communicates Derivative
121
- Works or copies thereof based upon both the Work and another work licensed under
122
- a Compatible Licence, this Distribution or Communication can be done under the
123
- terms of this Compatible Licence. For the sake of this clause, ‘Compatible
124
- Licence’ refers to the licences listed in the appendix attached to this Licence.
125
- Should the Licensee's obligations under the Compatible Licence conflict with
126
- his/her obligations under this Licence, the obligations of the Compatible
127
- Licence shall prevail.
128
-
129
- Provision of Source Code: When distributing or communicating copies of the Work,
130
- the Licensee will provide a machine-readable copy of the Source Code or indicate
131
- a repository where this Source will be easily and freely available for as long
132
- as the Licensee continues to distribute or communicate the Work.
133
-
134
- Legal Protection: This Licence does not grant permission to use the trade names,
135
- trademarks, service marks, or names of the Licensor, except as required for
136
- reasonable and customary use in describing the origin of the Work and
137
- reproducing the content of the copyright notice.
138
-
139
- 6. Chain of Authorship
140
-
141
- The original Licensor warrants that the copyright in the Original Work granted
142
- hereunder is owned by him/her or licensed to him/her and that he/she has the
143
- power and authority to grant the Licence.
144
-
145
- Each Contributor warrants that the copyright in the modifications he/she brings
146
- to the Work are owned by him/her or licensed to him/her and that he/she has the
147
- power and authority to grant the Licence.
148
-
149
- Each time You accept the Licence, the original Licensor and subsequent
150
- Contributors grant You a licence to their contributions to the Work, under the
151
- terms of this Licence.
152
-
153
- 7. Disclaimer of Warranty
154
-
155
- The Work is a work in progress, which is continuously improved by numerous
156
- Contributors. It is not a finished work and may therefore contain defects or
157
- ‘bugs’ inherent to this type of development.
158
-
159
- For the above reason, the Work is provided under the Licence on an ‘as is’ basis
160
- and without warranties of any kind concerning the Work, including without
161
- limitation merchantability, fitness for a particular purpose, absence of defects
162
- or errors, accuracy, non-infringement of intellectual property rights other than
163
- copyright as stated in Article 6 of this Licence.
164
-
165
- This disclaimer of warranty is an essential part of the Licence and a condition
166
- for the grant of any rights to the Work.
167
-
168
- 8. Disclaimer of Liability
169
-
170
- Except in the cases of wilful misconduct or damages directly caused to natural
171
- persons, the Licensor will in no event be liable for any direct or indirect,
172
- material or moral, damages of any kind, arising out of the Licence or of the use
173
- of the Work, including without limitation, damages for loss of goodwill, work
174
- stoppage, computer failure or malfunction, loss of data or any commercial
175
- damage, even if the Licensor has been advised of the possibility of such damage.
176
- However, the Licensor will be liable under statutory product liability laws as
177
- far such laws apply to the Work.
178
-
179
- 9. Additional agreements
180
-
181
- While distributing the Work, You may choose to conclude an additional agreement,
182
- defining obligations or services consistent with this Licence. However, if
183
- accepting obligations, You may act only on your own behalf and on your sole
184
- responsibility, not on behalf of the original Licensor or any other Contributor,
185
- and only if You agree to indemnify, defend, and hold each Contributor harmless
186
- for any liability incurred by, or claims asserted against such Contributor by
187
- the fact You have accepted any warranty or additional liability.
188
-
189
- 10. Acceptance of the Licence
190
-
191
- The provisions of this Licence can be accepted by clicking on an icon ‘I agree’
192
- placed under the bottom of a window displaying the text of this Licence or by
193
- affirming consent in any other similar way, in accordance with the rules of
194
- applicable law. Clicking on that icon indicates your clear and irrevocable
195
- acceptance of this Licence and all of its terms and conditions.
196
-
197
- Similarly, you irrevocably accept this Licence and all of its terms and
198
- conditions by exercising any rights granted to You by Article 2 of this Licence,
199
- such as the use of the Work, the creation by You of a Derivative Work or the
200
- Distribution or Communication by You of the Work or copies thereof.
201
-
202
- 11. Information to the public
203
-
204
- In case of any Distribution or Communication of the Work by means of electronic
205
- communication by You (for example, by offering to download the Work from a
206
- remote location) the distribution channel or media (for example, a website) must
207
- at least provide to the public the information requested by the applicable law
208
- regarding the Licensor, the Licence and the way it may be accessible, concluded,
209
- stored and reproduced by the Licensee.
210
-
211
- 12. Termination of the Licence
212
-
213
- The Licence and the rights granted hereunder will terminate automatically upon
214
- any breach by the Licensee of the terms of the Licence.
215
-
216
- Such a termination will not terminate the licences of any person who has
217
- received the Work from the Licensee under the Licence, provided such persons
218
- remain in full compliance with the Licence.
219
-
220
- 13. Miscellaneous
221
-
222
- Without prejudice of Article 9 above, the Licence represents the complete
223
- agreement between the Parties as to the Work.
224
-
225
- If any provision of the Licence is invalid or unenforceable under applicable
226
- law, this will not affect the validity or enforceability of the Licence as a
227
- whole. Such provision will be construed or reformed so as necessary to make it
228
- valid and enforceable.
229
-
230
- The European Commission may publish other linguistic versions or new versions of
231
- this Licence or updated versions of the Appendix, so far this is required and
232
- reasonable, without reducing the scope of the rights granted by the Licence. New
233
- versions of the Licence will be published with a unique version number.
234
-
235
- All linguistic versions of this Licence, approved by the European Commission,
236
- have identical value. Parties can take advantage of the linguistic version of
237
- their choice.
238
-
239
- 14. Jurisdiction
240
-
241
- Without prejudice to specific agreement between parties,
242
-
243
- - any litigation resulting from the interpretation of this License, arising
244
- between the European Union institutions, bodies, offices or agencies, as a
245
- Licensor, and any Licensee, will be subject to the jurisdiction of the Court
246
- of Justice of the European Union, as laid down in article 272 of the Treaty on
247
- the Functioning of the European Union,
248
-
249
- - any litigation arising between other parties and resulting from the
250
- interpretation of this License, will be subject to the exclusive jurisdiction
251
- of the competent court where the Licensor resides or conducts its primary
252
- business.
253
-
254
- 15. Applicable Law
255
-
256
- Without prejudice to specific agreement between parties,
257
-
258
- - this Licence shall be governed by the law of the European Union Member State
259
- where the Licensor has his seat, resides or has his registered office,
260
-
261
- - this licence shall be governed by Belgian law if the Licensor has no seat,
262
- residence or registered office inside a European Union Member State.
263
-
264
- Appendix
265
-
266
- ‘Compatible Licences’ according to Article 5 EUPL are:
267
-
268
- - GNU General Public License (GPL) v. 2, v. 3
269
- - GNU Affero General Public License (AGPL) v. 3
270
- - Open Software License (OSL) v. 2.1, v. 3.0
271
- - Eclipse Public License (EPL) v. 1.0
272
- - CeCILL v. 2.0, v. 2.1
273
- - Mozilla Public Licence (MPL) v. 2
274
- - GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
275
- - Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for
276
- works other than software
277
- - European Union Public Licence (EUPL) v. 1.1, v. 1.2
278
- - Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong
279
- Reciprocity (LiLiQ-R+).
280
-
281
- The European Commission may update this Appendix to later versions of the above
282
- licences without producing a new version of the EUPL, as long as they provide
283
- the rights granted in Article 2 of this Licence and protect the covered Source
284
- Code from exclusive appropriation.
285
-
286
- All other changes or additions to this Appendix require the production of a new
287
- EUPL version.
@@ -1,114 +0,0 @@
1
- import mesh2scattering as m2s
2
- import os
3
- import numpy as np
4
- import pyfar as pf
5
- import subprocess
6
- import warnings
7
- import trimesh
8
- import sofar as sf
9
-
10
-
11
- # directory of this file
12
- base_dir = os.path.dirname(__file__)
13
-
14
- # ignore tests for windows since its difficult to build the exe
15
- if os.name == 'nt':
16
- numcalc = os.path.join(
17
- m2s.utils.program_root(), "numcalc", "bin", "NumCalc.exe")
18
- numcalc_path = numcalc
19
- warnings.warn(
20
- ('Under Windows the code is not compiling but an executable is '
21
- f'expected in {numcalc}.'), UserWarning, stacklevel=2)
22
-
23
- else:
24
- # Build NumCalc locally to use for testing
25
- numcalc = os.path.join(
26
- m2s.utils.program_root(), "numcalc", "bin", "NumCalc")
27
- numcalc_path = numcalc
28
-
29
- if os.path.isfile(numcalc):
30
- os.remove(numcalc)
31
-
32
- subprocess.run(
33
- ["make"], cwd=os.path.join(
34
- m2s.utils.program_root(), "numcalc", "src"), check=True)
35
-
36
-
37
- def test_write_project(tmpdir):
38
-
39
- s2 = pf.Coordinates(0, 0, [3, 4], weights=[1, 1])
40
- s1 = pf.Coordinates(0, 0, 3, weights=[1])
41
-
42
- for frequencies in [np.array([500, 501]), np.array([500])]:
43
- for source_type in [
44
- m2s.input.SoundSourceType.POINT_SOURCE,
45
- m2s.input.SoundSourceType.PLANE_WAVE]:
46
- for sources in [s1, s2]:
47
- sound_sources = m2s.input.SoundSource(
48
- sources,
49
- source_type)
50
- points = pf.samplings.sph_gaussian(sh_order=63)
51
- evaluation_grid = m2s.input.EvaluationGrid.from_spherical(
52
- points,
53
- 'gaussian_63')
54
- surface_description = m2s.input.SurfaceDescription(
55
- .08, 0, 0.051/2.5, symmetry_azimuth=[90, 180])
56
- base_path = os.path.join(
57
- m2s.utils.repository_root(), 'tests', 'resources')
58
- sample = (
59
- f'reference_{source_type.name}_s{sources.csize}_'
60
- f'f{frequencies.size}')
61
- project_path = os.path.join(
62
- tmpdir, sample)
63
- project_title = sample
64
-
65
- mesh_path = os.path.join(
66
- base_path,
67
- 'mesh', 'reference_n4_0.5', 'sample.stl')
68
- sample_mesh = m2s.input.SampleMesh(
69
- trimesh.load_mesh(mesh_path),
70
- surface_description,
71
- 0.01,
72
- 0.8,
73
- m2s.input.SampleShape.ROUND,
74
- )
75
- bem_method = 'ML-FMM BEM'
76
- m2s.input.write_scattering_project_numcalc(
77
- project_path,
78
- project_title,
79
- frequencies,
80
- sound_sources,
81
- [evaluation_grid],
82
- sample_mesh,
83
- bem_method,
84
- speed_of_sound=346.18,
85
- density_of_medium=1.1839,
86
- )
87
- m2s.numcalc.manage_numcalc(
88
- tmpdir, numcalc, wait_time=0)
89
- for frequencies in [1, 2]:
90
- for source_type in ['POINT_SOURCE', 'PLANE_WAVE']:
91
- for sources in [1, 2]:
92
- sample = f'reference_{source_type}_s{sources}_f{frequencies}'
93
- project_path = os.path.join(tmpdir, sample)
94
- m2s.output.write_pressure(project_path)
95
-
96
-
97
- sofa = sf.read_sofa(
98
- os.path.join(
99
- project_path, '..',
100
- f'{sample}_gaussian_63.pressure.sofa'))
101
- pressure, sources, receivers = pf.io.convert_sofa(sofa)
102
-
103
- # check if the sofa file is correct
104
- assert pressure.cshape[0] == sources.csize
105
- assert pressure.cshape[1] == receivers.csize
106
- assert isinstance(sofa.SpeedOfSound, float)
107
- assert isinstance(sofa.SampleStructuralWavelengthX, float)
108
- assert isinstance(sofa.SampleStructuralWavelengthY, float)
109
- assert isinstance(sofa.SampleDiameter, float)
110
- assert isinstance(sofa.ReceiverWeights, np.ndarray)
111
- assert sofa.ReceiverWeights.size == receivers.csize
112
- assert np.atleast_1d(sofa.SourceWeights).size == sources.csize
113
-
114
-