scimba 0.4.0__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.
Files changed (133) hide show
  1. scimba-0.4.0/LICENSE +21 -0
  2. scimba-0.4.0/PKG-INFO +136 -0
  3. scimba-0.4.0/README.md +105 -0
  4. scimba-0.4.0/pyproject.toml +43 -0
  5. scimba-0.4.0/setup.cfg +4 -0
  6. scimba-0.4.0/src/applications/__init__.py +0 -0
  7. scimba-0.4.0/src/scimba/__init__.py +14 -0
  8. scimba-0.4.0/src/scimba/equations/__init__.py +3 -0
  9. scimba-0.4.0/src/scimba/equations/domain.py +690 -0
  10. scimba-0.4.0/src/scimba/equations/genericSL_advection_diffusion_equation.py +77 -0
  11. scimba-0.4.0/src/scimba/equations/nonlinear_ode_basic.py +321 -0
  12. scimba-0.4.0/src/scimba/equations/ode_basic.py +339 -0
  13. scimba-0.4.0/src/scimba/equations/pde_1d_antiderivative.py +49 -0
  14. scimba-0.4.0/src/scimba/equations/pde_1d_elliptic.py +48 -0
  15. scimba-0.4.0/src/scimba/equations/pde_1d_heat.py +75 -0
  16. scimba-0.4.0/src/scimba/equations/pde_1d_laplacian.py +115 -0
  17. scimba-0.4.0/src/scimba/equations/pde_1d_laplacian_xv.py +60 -0
  18. scimba-0.4.0/src/scimba/equations/pde_1x1v_transport.py +83 -0
  19. scimba-0.4.0/src/scimba/equations/pde_2d_laplacian.py +49 -0
  20. scimba-0.4.0/src/scimba/equations/pdes.py +1023 -0
  21. scimba-0.4.0/src/scimba/generativenets/__init__.py +4 -0
  22. scimba-0.4.0/src/scimba/generativenets/energy_models.py +1 -0
  23. scimba-0.4.0/src/scimba/generativenets/gaussian_mixtures.py +173 -0
  24. scimba-0.4.0/src/scimba/generativenets/normalizingflows.py +135 -0
  25. scimba-0.4.0/src/scimba/generativenets/simpleflows.py +197 -0
  26. scimba-0.4.0/src/scimba/generativenets/trainer_likelihood.py +216 -0
  27. scimba-0.4.0/src/scimba/largenets/__init__.py +3 -0
  28. scimba-0.4.0/src/scimba/largenets/continuous_autoencoder.py +64 -0
  29. scimba-0.4.0/src/scimba/largenets/pointnet.py +269 -0
  30. scimba-0.4.0/src/scimba/nets/__init__.py +4 -0
  31. scimba-0.4.0/src/scimba/nets/activation.py +417 -0
  32. scimba-0.4.0/src/scimba/nets/convexnet.py +46 -0
  33. scimba-0.4.0/src/scimba/nets/henonnet.py +48 -0
  34. scimba-0.4.0/src/scimba/nets/mlp.py +273 -0
  35. scimba-0.4.0/src/scimba/nets/rbfnet.py +143 -0
  36. scimba-0.4.0/src/scimba/nets/siren.py +137 -0
  37. scimba-0.4.0/src/scimba/nets/training.py +251 -0
  38. scimba-0.4.0/src/scimba/nets/training_tools.py +147 -0
  39. scimba-0.4.0/src/scimba/neural_operators/__init__.py +6 -0
  40. scimba-0.4.0/src/scimba/neural_operators/deep_operator_t.py +52 -0
  41. scimba-0.4.0/src/scimba/neural_operators/deep_operator_tx.py +61 -0
  42. scimba-0.4.0/src/scimba/neural_operators/deep_operator_x.py +61 -0
  43. scimba-0.4.0/src/scimba/neural_operators/deeponet_t.py +129 -0
  44. scimba-0.4.0/src/scimba/neural_operators/deeponet_tx.py +239 -0
  45. scimba-0.4.0/src/scimba/neural_operators/deeponet_x.py +176 -0
  46. scimba-0.4.0/src/scimba/neural_operators/greenkernel_t.py +36 -0
  47. scimba-0.4.0/src/scimba/neural_operators/greenkernel_tx.py +48 -0
  48. scimba-0.4.0/src/scimba/neural_operators/greenkernel_x.py +47 -0
  49. scimba-0.4.0/src/scimba/neural_operators/kernel_layer_t.py +19 -0
  50. scimba-0.4.0/src/scimba/neural_operators/kernel_layer_x.py +37 -0
  51. scimba-0.4.0/src/scimba/neural_operators/kernel_layer_xt.py +38 -0
  52. scimba-0.4.0/src/scimba/neural_operators/local_sublayer.py +95 -0
  53. scimba-0.4.0/src/scimba/neural_operators/pre_post_processinglayer.py +83 -0
  54. scimba-0.4.0/src/scimba/neuralgalerkin/__init__.py +4 -0
  55. scimba-0.4.0/src/scimba/neuralgalerkin/elliptic_reduced_ng.py +28 -0
  56. scimba-0.4.0/src/scimba/neuralgalerkin/neural_galerkin_x.py +363 -0
  57. scimba-0.4.0/src/scimba/neuralgalerkin/neural_galerkin_xv.py +316 -0
  58. scimba-0.4.0/src/scimba/neuralgalerkin/projector_training.py +134 -0
  59. scimba-0.4.0/src/scimba/neuralgalerkin/reduced_ng.py +274 -0
  60. scimba-0.4.0/src/scimba/numericalmethods/__init__.py +3 -0
  61. scimba-0.4.0/src/scimba/numericalmethods/mesh.py +113 -0
  62. scimba-0.4.0/src/scimba/numericalmethods/neural_finite_element.py +119 -0
  63. scimba-0.4.0/src/scimba/numericalmethods/neural_spectral.py +0 -0
  64. scimba-0.4.0/src/scimba/odelearning/__init__.py +7 -0
  65. scimba-0.4.0/src/scimba/odelearning/abstract_ode.py +89 -0
  66. scimba-0.4.0/src/scimba/odelearning/generation_ode_data.py +68 -0
  67. scimba-0.4.0/src/scimba/odelearning/generic_flux.py +55 -0
  68. scimba-0.4.0/src/scimba/odelearning/loss_odelearning.py +60 -0
  69. scimba-0.4.0/src/scimba/odelearning/training_diffphy_ode.py +105 -0
  70. scimba-0.4.0/src/scimba/pinns/__init__.py +7 -0
  71. scimba-0.4.0/src/scimba/pinns/pinn_losses.py +303 -0
  72. scimba-0.4.0/src/scimba/pinns/pinn_t.py +453 -0
  73. scimba-0.4.0/src/scimba/pinns/pinn_tx.py +458 -0
  74. scimba-0.4.0/src/scimba/pinns/pinn_txv.py +368 -0
  75. scimba-0.4.0/src/scimba/pinns/pinn_x.py +543 -0
  76. scimba-0.4.0/src/scimba/pinns/pinn_xv.py +245 -0
  77. scimba-0.4.0/src/scimba/pinns/training_t.py +421 -0
  78. scimba-0.4.0/src/scimba/pinns/training_tx.py +554 -0
  79. scimba-0.4.0/src/scimba/pinns/training_txv.py +504 -0
  80. scimba-0.4.0/src/scimba/pinns/training_x.py +1237 -0
  81. scimba-0.4.0/src/scimba/pinns/training_xv.py +423 -0
  82. scimba-0.4.0/src/scimba/pinos/__init__.py +3 -0
  83. scimba-0.4.0/src/scimba/pinos/pino_t.py +96 -0
  84. scimba-0.4.0/src/scimba/pinos/pino_tx.py +186 -0
  85. scimba-0.4.0/src/scimba/pinos/pino_x.py +199 -0
  86. scimba-0.4.0/src/scimba/pinos/training_t.py +312 -0
  87. scimba-0.4.0/src/scimba/pinos/training_tx.py +438 -0
  88. scimba-0.4.0/src/scimba/pinos/training_x.py +393 -0
  89. scimba-0.4.0/src/scimba/sampling/__init__.py +3 -0
  90. scimba-0.4.0/src/scimba/sampling/abstract_sampling.py +39 -0
  91. scimba-0.4.0/src/scimba/sampling/data_sampling_ode.py +250 -0
  92. scimba-0.4.0/src/scimba/sampling/data_sampling_pde_tx.py +581 -0
  93. scimba-0.4.0/src/scimba/sampling/data_sampling_pde_x.py +382 -0
  94. scimba-0.4.0/src/scimba/sampling/grid_sampling.py +51 -0
  95. scimba-0.4.0/src/scimba/sampling/quad.py +30 -0
  96. scimba-0.4.0/src/scimba/sampling/sampling_functions.py +464 -0
  97. scimba-0.4.0/src/scimba/sampling/sampling_ode.py +213 -0
  98. scimba-0.4.0/src/scimba/sampling/sampling_parameters.py +56 -0
  99. scimba-0.4.0/src/scimba/sampling/sampling_pde.py +446 -0
  100. scimba-0.4.0/src/scimba/sampling/sampling_pde_txv.py +359 -0
  101. scimba-0.4.0/src/scimba/sampling/uniform_sampling.py +318 -0
  102. scimba-0.4.0/src/scimba.egg-info/PKG-INFO +136 -0
  103. scimba-0.4.0/src/scimba.egg-info/SOURCES.txt +131 -0
  104. scimba-0.4.0/src/scimba.egg-info/dependency_links.txt +1 -0
  105. scimba-0.4.0/src/scimba.egg-info/requires.txt +20 -0
  106. scimba-0.4.0/src/scimba.egg-info/top_level.txt +2 -0
  107. scimba-0.4.0/tests/test_DeepOnet_space.py +154 -0
  108. scimba-0.4.0/tests/test_DeepOnet_time.py +125 -0
  109. scimba-0.4.0/tests/test_Laplacian2D.py +129 -0
  110. scimba-0.4.0/tests/test_advection_xv1d_nn.py +94 -0
  111. scimba-0.4.0/tests/test_cond.py +134 -0
  112. scimba-0.4.0/tests/test_gaussianmixture.py +44 -0
  113. scimba-0.4.0/tests/test_grad_div_2D_pinns.py +116 -0
  114. scimba-0.4.0/tests/test_heat_pinns.py +105 -0
  115. scimba-0.4.0/tests/test_import.py +4 -0
  116. scimba-0.4.0/tests/test_kinetic_constant_transport_1X1V.py +44 -0
  117. scimba-0.4.0/tests/test_laplacian2D_bean.py +291 -0
  118. scimba-0.4.0/tests/test_laplacian2D_domainhole.py +176 -0
  119. scimba-0.4.0/tests/test_laplacian2D_rbfnet_pinns.py +93 -0
  120. scimba-0.4.0/tests/test_laplacian2D_signeddistance.py +103 -0
  121. scimba-0.4.0/tests/test_laplacian_1d.py +46 -0
  122. scimba-0.4.0/tests/test_linearized_Euler.py +126 -0
  123. scimba-0.4.0/tests/test_mlp.py +56 -0
  124. scimba-0.4.0/tests/test_multiscale_fourier.py +125 -0
  125. scimba-0.4.0/tests/test_neural_galerkin.py +89 -0
  126. scimba-0.4.0/tests/test_nonlinear_Laplacian_2D.py +484 -0
  127. scimba-0.4.0/tests/test_nonlinear_odes.py +215 -0
  128. scimba-0.4.0/tests/test_nonlinear_spacetime_system.py +231 -0
  129. scimba-0.4.0/tests/test_normalizingflow.py +61 -0
  130. scimba-0.4.0/tests/test_odelearning_sir.py +88 -0
  131. scimba-0.4.0/tests/test_pendulum.py +201 -0
  132. scimba-0.4.0/tests/test_poisson_xv1D.py +55 -0
  133. scimba-0.4.0/tests/test_simple_ode.py +49 -0
scimba-0.4.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Emmanuel Franck
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
scimba-0.4.0/PKG-INFO ADDED
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.1
2
+ Name: scimba
3
+ Version: 0.4.0
4
+ Summary: This library implements some common tools for scientific machine learning
5
+ Author: Emmanuel Franck
6
+ License: MIT
7
+ Project-URL: Homepage, https://gitlab.inria.fr/sciml/scimba
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: matplotlib
15
+ Requires-Dist: numpy
16
+ Requires-Dist: torch==2.0.1
17
+ Requires-Dist: scipy
18
+ Requires-Dist: tqdm
19
+ Provides-Extra: test
20
+ Requires-Dist: pytest; extra == "test"
21
+ Requires-Dist: pytest-cov; extra == "test"
22
+ Requires-Dist: scikit-learn; extra == "test"
23
+ Provides-Extra: doc
24
+ Requires-Dist: sphinx; extra == "doc"
25
+ Requires-Dist: sphinx-autobuild; extra == "doc"
26
+ Requires-Dist: furo; extra == "doc"
27
+ Provides-Extra: examples
28
+ Requires-Dist: h5py; extra == "examples"
29
+ Requires-Dist: PyYAML; extra == "examples"
30
+ Requires-Dist: scikit-learn; extra == "examples"
31
+
32
+ # ScimBa
33
+
34
+ [Documentation](https://sciml.gitlabpages.inria.fr/scimba)
35
+ [![pylint](https://sciml.gitlabpages.inria.fr/scimba/badges/pylint.svg)](https://sciml.gitlabpages.inria.fr/scimba/lint/)
36
+
37
+ This librairies impliment varying SciML methods for varying PDE problem and also tools to build hybrid numerical methods.
38
+
39
+ ## Current Content
40
+
41
+ - **Nets**: MLP networks, Discontinuous MLP, RBF networks, some activations functions and a basic trainer
42
+ - **Sampling and domain**: general uniform sampling methods for PINNs and Neural Operators. Sampling based on approximated signed distance function for general geometries.
43
+ - **PDEs**: the librairiy implement différent type of model: ODE, spatial pde, times-apce pde, stationary kinetic PDE and kinetic PDE.
44
+ - **Specific networks for PINNs**: For all the equations we implement PINNs networks based on: MLP, Discontinuous MLP and nonlinear radial basis function.
45
+ We implement also the Fourier network with general features (Fourier but also Gaussian etc)
46
+ - **Trainer**: for each type of PDE we gives a specific trainer.
47
+ - **Generative Nets**: Normalized flows, Gaussian mixture. The classical and conditional approaches are proposed. Trainer based on the maximum likelihood principle.
48
+ - **Neural Operator**: Continuous Auto-encoder based on PointNet encoder and coordinate based decoder. Physic informed DeepOnet for ODE, spatial and time space PDE.
49
+ - **Neural Galerkin**: Method Neural Galerkin for time PDE based on the same network than PINNs.
50
+
51
+
52
+ ## Ongoing work for 2024
53
+ - **Nets**: New activation function used for implicit representation, Symbolic models, Sindy
54
+ - **Sampling and domain**: learning of signed distance function using PINNs, adaptive sampling
55
+ - **Specific networks for PINNs**: Multiscale architecture, spectral architecture for kinetic, specific architecture.
56
+ - **Trainer**: Trainer with sparsity constraints and globalization method. Loss Balancing
57
+ - **Generative Nets**: Energy models, score matching, more complex normalized flow, Continuous VAE
58
+ - **Neural Operator**: physic informed DeepGreen operator, FNO, GINO based on FNO, NO with neural implicit representation. Kinetic case
59
+ - **Neural Galerkin**: Adaptive sampling, randomization, Least Square solver, implicit scheme. CROM Space time reduced Galerkin model. Greedy basis.
60
+
61
+
62
+ ## References
63
+
64
+ ### PINNs and MLP
65
+
66
+ - https://www.sciencedirect.com/science/article/abs/pii/S0021999118307125
67
+ - https://arxiv.org/abs/2209.03984
68
+ - https://arxiv.org/abs/1912.00873
69
+ - https://arxiv.org/abs/1912.00873
70
+ - https://arxiv.org/abs/2109.01050
71
+ - https://arxiv.org/abs/2203.01360
72
+ - https://arxiv.org/abs/2103.09959
73
+ - https://openreview.net/forum?id=vsMyHUq_C1c
74
+
75
+ ### Neural Galerkin
76
+
77
+ - https://arxiv.org/abs/2306.15630
78
+ - https://arxiv.org/abs/2306.03749
79
+ - https://arxiv.org/abs/2207.13828
80
+ - https://arxiv.org/abs/2201.07953
81
+ - https://arxiv.org/abs/2104.13515
82
+
83
+ ### DeepOnet
84
+
85
+ - https://www.nature.com/articles/s42256-021-00302-5
86
+ - https://www.science.org/doi/10.1126/sciadv.abi8605
87
+ - https://arxiv.org/abs/2205.11404
88
+ - https://arxiv.org/abs/2206.03551
89
+
90
+ ### FNO and diverse geometry
91
+
92
+ - https://openreview.net/forum?id=c8P9NQVtmnO
93
+ - https://arxiv.org/abs/2207.05209
94
+ - https://arxiv.org/abs/2212.04689
95
+ - https://arxiv.org/abs/2305.00478
96
+ - https://arxiv.org/abs/2306.05697
97
+ - https://arxiv.org/abs/2305.19663
98
+
99
+ ### Other NO
100
+
101
+ - https://openreview.net/forum?id=LZDiWaC9CGL
102
+ - https://arxiv.org/abs/2205.10573
103
+ - https://arxiv.org/abs/2205.02191
104
+ - https://openreview.net/forum?id=kIo_C6QmMOM
105
+ - https://arxiv.org/abs/2303.10528
106
+ - https://arxiv.org/abs/2302.05925
107
+
108
+ ## Install the project
109
+
110
+ ```bash
111
+ git clone https://gitlab.inria.fr/sciml/scimba.git
112
+ cd scimba
113
+ ```
114
+
115
+ ## Install the package
116
+
117
+ ```bash
118
+ pip install -e .
119
+ ```
120
+
121
+ ## Launch tests
122
+
123
+ ```bash
124
+ pip install -e ".[test]"
125
+ pytest
126
+ ```
127
+
128
+ ## Generate documentation
129
+
130
+ ```bash
131
+ pip install -e ".[doc]"
132
+ cd docs
133
+ env PYTORCH_JIT=0 make html
134
+ ```
135
+
136
+ html docs are generated in \_build/html
scimba-0.4.0/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # ScimBa
2
+
3
+ [Documentation](https://sciml.gitlabpages.inria.fr/scimba)
4
+ [![pylint](https://sciml.gitlabpages.inria.fr/scimba/badges/pylint.svg)](https://sciml.gitlabpages.inria.fr/scimba/lint/)
5
+
6
+ This librairies impliment varying SciML methods for varying PDE problem and also tools to build hybrid numerical methods.
7
+
8
+ ## Current Content
9
+
10
+ - **Nets**: MLP networks, Discontinuous MLP, RBF networks, some activations functions and a basic trainer
11
+ - **Sampling and domain**: general uniform sampling methods for PINNs and Neural Operators. Sampling based on approximated signed distance function for general geometries.
12
+ - **PDEs**: the librairiy implement différent type of model: ODE, spatial pde, times-apce pde, stationary kinetic PDE and kinetic PDE.
13
+ - **Specific networks for PINNs**: For all the equations we implement PINNs networks based on: MLP, Discontinuous MLP and nonlinear radial basis function.
14
+ We implement also the Fourier network with general features (Fourier but also Gaussian etc)
15
+ - **Trainer**: for each type of PDE we gives a specific trainer.
16
+ - **Generative Nets**: Normalized flows, Gaussian mixture. The classical and conditional approaches are proposed. Trainer based on the maximum likelihood principle.
17
+ - **Neural Operator**: Continuous Auto-encoder based on PointNet encoder and coordinate based decoder. Physic informed DeepOnet for ODE, spatial and time space PDE.
18
+ - **Neural Galerkin**: Method Neural Galerkin for time PDE based on the same network than PINNs.
19
+
20
+
21
+ ## Ongoing work for 2024
22
+ - **Nets**: New activation function used for implicit representation, Symbolic models, Sindy
23
+ - **Sampling and domain**: learning of signed distance function using PINNs, adaptive sampling
24
+ - **Specific networks for PINNs**: Multiscale architecture, spectral architecture for kinetic, specific architecture.
25
+ - **Trainer**: Trainer with sparsity constraints and globalization method. Loss Balancing
26
+ - **Generative Nets**: Energy models, score matching, more complex normalized flow, Continuous VAE
27
+ - **Neural Operator**: physic informed DeepGreen operator, FNO, GINO based on FNO, NO with neural implicit representation. Kinetic case
28
+ - **Neural Galerkin**: Adaptive sampling, randomization, Least Square solver, implicit scheme. CROM Space time reduced Galerkin model. Greedy basis.
29
+
30
+
31
+ ## References
32
+
33
+ ### PINNs and MLP
34
+
35
+ - https://www.sciencedirect.com/science/article/abs/pii/S0021999118307125
36
+ - https://arxiv.org/abs/2209.03984
37
+ - https://arxiv.org/abs/1912.00873
38
+ - https://arxiv.org/abs/1912.00873
39
+ - https://arxiv.org/abs/2109.01050
40
+ - https://arxiv.org/abs/2203.01360
41
+ - https://arxiv.org/abs/2103.09959
42
+ - https://openreview.net/forum?id=vsMyHUq_C1c
43
+
44
+ ### Neural Galerkin
45
+
46
+ - https://arxiv.org/abs/2306.15630
47
+ - https://arxiv.org/abs/2306.03749
48
+ - https://arxiv.org/abs/2207.13828
49
+ - https://arxiv.org/abs/2201.07953
50
+ - https://arxiv.org/abs/2104.13515
51
+
52
+ ### DeepOnet
53
+
54
+ - https://www.nature.com/articles/s42256-021-00302-5
55
+ - https://www.science.org/doi/10.1126/sciadv.abi8605
56
+ - https://arxiv.org/abs/2205.11404
57
+ - https://arxiv.org/abs/2206.03551
58
+
59
+ ### FNO and diverse geometry
60
+
61
+ - https://openreview.net/forum?id=c8P9NQVtmnO
62
+ - https://arxiv.org/abs/2207.05209
63
+ - https://arxiv.org/abs/2212.04689
64
+ - https://arxiv.org/abs/2305.00478
65
+ - https://arxiv.org/abs/2306.05697
66
+ - https://arxiv.org/abs/2305.19663
67
+
68
+ ### Other NO
69
+
70
+ - https://openreview.net/forum?id=LZDiWaC9CGL
71
+ - https://arxiv.org/abs/2205.10573
72
+ - https://arxiv.org/abs/2205.02191
73
+ - https://openreview.net/forum?id=kIo_C6QmMOM
74
+ - https://arxiv.org/abs/2303.10528
75
+ - https://arxiv.org/abs/2302.05925
76
+
77
+ ## Install the project
78
+
79
+ ```bash
80
+ git clone https://gitlab.inria.fr/sciml/scimba.git
81
+ cd scimba
82
+ ```
83
+
84
+ ## Install the package
85
+
86
+ ```bash
87
+ pip install -e .
88
+ ```
89
+
90
+ ## Launch tests
91
+
92
+ ```bash
93
+ pip install -e ".[test]"
94
+ pytest
95
+ ```
96
+
97
+ ## Generate documentation
98
+
99
+ ```bash
100
+ pip install -e ".[doc]"
101
+ cd docs
102
+ env PYTORCH_JIT=0 make html
103
+ ```
104
+
105
+ html docs are generated in \_build/html
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.2"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "scimba"
7
+ authors = [{ name = "Emmanuel Franck" }]
8
+ description = "This library implements some common tools for scientific machine learning"
9
+ classifiers = [
10
+ "Programming Language :: Python :: 3",
11
+ "License :: OSI Approved :: MIT License",
12
+ "Operating System :: OS Independent",
13
+ ]
14
+ requires-python = ">=3.9"
15
+ dependencies = ["matplotlib", "numpy", "torch==2.0.1", "scipy", "tqdm"]
16
+ dynamic = ["version"]
17
+
18
+ [project.readme]
19
+ file = "README.md"
20
+ content-type = "text/markdown"
21
+
22
+ [project.license]
23
+ text = "MIT"
24
+
25
+ [project.urls]
26
+ Homepage = "https://gitlab.inria.fr/sciml/scimba"
27
+
28
+ [project.optional-dependencies]
29
+ test = ["pytest", "pytest-cov", "scikit-learn"]
30
+ doc = ["sphinx", "sphinx-autobuild", "furo"]
31
+ examples = ["h5py", "PyYAML", "scikit-learn"]
32
+
33
+ [tool.setuptools]
34
+ include-package-data = true
35
+ license-files = ["LICENSE"]
36
+ package-dir = { "" = "src"}
37
+
38
+ [tool.setuptools.packages.find]
39
+ where = ["src"]
40
+ namespaces = false
41
+
42
+ [tool.setuptools.dynamic.version]
43
+ attr = "scimba.__version__"
scimba-0.4.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,14 @@
1
+ import torch
2
+
3
+ __version__ = "0.4.0"
4
+
5
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
6
+ torch.set_default_device(device)
7
+ torch.set_default_dtype(torch.float)
8
+
9
+ print("Using device:", device)
10
+
11
+ if torch.cuda.is_available():
12
+ print(f"cuda devices: {torch.cuda.device_count()}")
13
+ print(f"cuda current device: {torch.cuda.current_device()}")
14
+ print(f"cuda device name: {torch.cuda.get_device_name(0)}")
@@ -0,0 +1,3 @@
1
+ """
2
+ Abstract classes for equations (ODEs and PDEs), with some examples, and definitions of space and time domains.
3
+ """