diff --git a/.gitattributes b/.gitattributes index 47a9831f0..c4b8d507a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,7 +11,11 @@ pygimli/_version.py export-subst *.sh text # Declare files that will always have CRLF line endings on checkout. -# *.sln text eol=crlf +*.py text eol=crlf +*.md text eol=crlf +*.rst text eol=crlf +*.bib text eol=crlf +*.txt text eol=crlf # Denote all files that are truly binary and should not be modified. *.png binary diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 000000000..228accab4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,107 @@ +name: Bug Report +description: Please use this form to file a bug report. +labels: ["bug"] +body: + - type: markdown + attributes: + value: Thanks for taking the time to fill out this bug report! To facilitate efficient support, please fill out all the information applicable to your issue. + - type: markdown + attributes: + value: "### Problem description" + - type: textarea + id: problem-description + attributes: + label: Problem description + description: Please provide a general description of the issue here. + - type: markdown + attributes: + value: "### Your environment" + - type: textarea + id: environment-report + attributes: + label: Your environment + description: Please provide the output of `print(pygimli.Report())` here. If that does not work, please fill out the information on operating system, Python version and pyGIMLi version below. + render: shell + - type: dropdown + id: os + attributes: + label: Operating System + description: Which operating system are you using? + options: + - Windows + - Mac + - Linux + - type: dropdown + id: python-version + attributes: + label: Which Python version are you using? + options: + - 3.15 + - 3.14 + - 3.13 + - 3.12 + - 3.11 + - 3.10 + - 3.9 + - type: input + id: way-of-installation + attributes: + label: Way of installation + description: Please describe your way of installing pyGIMLi, e.g. Conda package, manual compilation from source etc. + - type: dropdown + id: pygimli-version + attributes: + label: Which version of PyGIMLI are you using? + description: Output of `print(pygimli.__version__)` + options: + - 1.5.4 + - 1.5.3 + - 1.5.2 + - 1.5.1 + - 1.5.0 + - type: textarea + id: environment-additional + attributes: + label: Additional information on the environment + description: If you have additional information on the environment or installation that did not fit the forms above, please enter it here. + - type: markdown + attributes: + value: "### Reproducing the issue" + - type: textarea + id: reproduce-steps + attributes: + label: Steps to reproduce the issue + description: If there are specific steps necessary to reproduce the issue, please describe them here. + - type: textarea + id: reproduce-code + attributes: + label: Code to reproduce the issue + description: Please provide the code that produces the error in the form of a minimal reproducible example. Alternatively, you can also attach the code as a file in the field below. + render: shell + - type: textarea + id: reproduce-data + attributes: + label: Additional data to reproduce the issue + description: Please provide additional data that is necessary to reproduce the error, e.g. data files, additional code or Python dependencies. + - type: markdown + attributes: + value: "### Expected behavior" + - type: textarea + id: expected + attributes: + label: Expected behavior + description: Tell us what should happen or what you want to achieve. + - type: markdown + attributes: + value: "### Actual behavior" + - type: textarea + id: actual-text + attributes: + label: Actual behavior + description: Please tell us what happens instead of the expected behavior. + - type: textarea + id: actual-output + attributes: + label: Output of your script + description: If applicable, please provide the output of your script that shows the actual behavior. + render: shell diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 000000000..90ce411b8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,9 @@ +name: Feature Request +description: Please use this form to propose a new feature for pyGIMLi. +labels: ["feature request"] +body: +- type: textarea + id: feature-request + attributes: + label: Feature Request + description: Please provide details on the feature request here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 000000000..77e5599cb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,9 @@ +name: Question +description: Please use this form if you expect that your issue is rather a question than a problem with the code. +labels: ["question"] +body: +- type: textarea + id: question + attributes: + label: Question + description: Please provide details on your issue or question. \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 45659460a..d4dfcb77f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,25 +60,28 @@ jobs: working-directory: build run: xvfb-run make doc # xvfb is necessary for headless display of pyvista plots merging: - name: Merging dev into master + name: Automerging runs-on: self-hosted needs: docs if: github.ref == 'refs/heads/dev' # Only merge from dev steps: - - name: Merge into master - uses: devmasx/merge-branch@master - with: - type: now - target_branch: master - github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Merge dev -> master (with rebase) + working-directory: source + run: | + git config --local user.email "actions@github.com" + git config --local user.name "GitHub Actions" + git remote set-url origin https://florian-wagner:${{ secrets.SECRET }}@github.com/gimli-org/gimli.git + git fetch + git rebase origin/master + git push origin HEAD:master --force-with-lease upload-html: name: Upload HTML to dev.pygimli.org runs-on: self-hosted needs: docs if: github.ref == 'refs/heads/dev' # Only merge from dev steps: - - name: Merge into master + - name: Uploading built html files working-directory: build run: rsync -avP --delete doc/html/ /var/www/html - - + + diff --git a/.gitignore b/.gitignore index fa5c1d7c9..ba28ed3ba 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ doc/_static/usecases/original/ *.ipynb *.ipynb_checkpoints* +doc/user-guide/*_files +doc/user-guide/*.html + # Customizations *.log *.pdf @@ -110,4 +113,4 @@ pygimli/core/libgimli.dll.back pygimli/core/_pygimli_.pyd.back pygimli/core/_pygimli_.so.dSYM/ pygimli/VERSION -synth.ves \ No newline at end of file +synth.ves diff --git a/.jenkins.sh b/.jenkins.sh index 9845d828b..3896229a0 100644 --- a/.jenkins.sh +++ b/.jenkins.sh @@ -80,8 +80,8 @@ export PYVISTA_OFF_SCREEN=true export PYTHONPATH=`pwd`/../trunk:$PYTHONPATH OMP_THREAD_LIMIT=4 python -c "import pygimli; print(pygimli.Report()); pygimli.test(show=False, abort=True, htmlreport=\"build_tests.html\", devTests=True)" -# Build documentation -make clean-gallery +#Build documentation +#make clean-gallery # TMP for fast Jenkins builds make doc # = doxygen, sphinxapi, sphinxpdf, sphinxhtml end=$(date +"%s") echo "Ending automatic build #$BUILD_NUMBER". diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 000000000..5f352ed3d --- /dev/null +++ b/AUTHORS.md @@ -0,0 +1,17 @@ +- [Carsten Rücker](https://orcid.org/0000-0002-8231-9861) + + *Berlin University of Technology, Department of Applied Geophysics, Berlin, Germany* + + + +- [Thomas Günther](https://orcid.org/0000-0001-5409-0273) + + *TU Bergakademie Freiberg, Electromagnetics and potential methods working group, Freiberg, Germany* + + + +- [Florian Wagner](https://orcid.org/0000-0001-7407-9741) + + *RWTH Aachen University, Geophysical Imaging and Monitoring (GIM), Aachen, Germany* + + \ No newline at end of file diff --git a/AUTHORS.rst b/AUTHORS.rst deleted file mode 100644 index d7d2db53a..000000000 --- a/AUTHORS.rst +++ /dev/null @@ -1,31 +0,0 @@ -* `Carsten Rücker `_ - - *Berlin University of Technology, Department of Applied Geophysics, Berlin, Germany* - - carsten@pygimli.org - -* `Thomas Günther `_ - - *Leibniz Institute for Applied Geophysics, Hannover, Germany* - - thomas@pygimli.org - -* `Florian Wagner `_ - - *RWTH Aachen University, Geophysical Imaging and Monitoring (GIM), Aachen, Germany* - - florian@pygimli.org - -* Friedrich Dinsel - - *Berlin University of Technology, Department of Applied Geophysics, Berlin, Germany* - - friedrich@pygimli.org - -* `Maximilian Weigand `_ - - *University of Bonn, Department of Geophysics, Bonn, Germany* - -* `Andrea Balza `_ - - *RWTH Aachen University, Geophysical Imaging and Monitoring (GIM), Aachen, Germany* diff --git a/CITATION.md b/CITATION.md new file mode 100644 index 000000000..2bd202fa1 --- /dev/null +++ b/CITATION.md @@ -0,0 +1,29 @@ +# Citing pyGIMLi + +If you use pyGIMLi for your work, please cite [this paper](http://www.sciencedirect.com/science/article/pii/S0098300417300584/pdfft?md5=44253eaacd5490e3fb32210671672496&pid=1-s2.0-S0098300417300584-main.pdf) as: + +> Rücker, C., Günther, T., Wagner, F.M., 2017. pyGIMLi: An open-source library +> for modelling and inversion in geophysics, Computers and Geosciences, 109, +> 106-123, doi: 10.1016/j.cageo.2017.07.011. + +```{raw} html +
+``` + +Scripts to reproduce the figures in the paper can be found at +. + +BibTeX code: + +```bibtex +@article{Ruecker2017, + title = {{pyGIMLi}: An open-source library for modelling and inversion in geophysics}, + journal = {Computers and Geosciences}, + volume = {109}, + pages = {106--123}, + year = {2017}, + doi = {10.1016/j.cageo.2017.07.011}, + url = {https://www.sciencedirect.com/science/article/pii/S0098300417300584}, + author = {R\"ucker, C. and G\"unther, T. and Wagner, F. M.} +} +``` diff --git a/CITATION.rst b/CITATION.rst deleted file mode 100644 index b80f0b7f0..000000000 --- a/CITATION.rst +++ /dev/null @@ -1,30 +0,0 @@ -Citing pyGIMLi --------------- - -If you use pyGIMLi for your work, please cite `this paper `_ as: - - Rücker, C., Günther, T., Wagner, F.M., 2017. pyGIMLi: An open-source library - for modelling and inversion in geophysics, Computers and Geosciences, 109, - 106-123, doi: 10.1016/j.cageo.2017.07.011. - -.. raw:: html - -
- -Scripts to reproduce the figures in the paper can be found at -https://cg17.pygimli.org. - -BibTeX code: - -.. code-block:: bibtex - - @article{Ruecker2017, - title = {{pyGIMLi}: An open-source library for modelling and inversion in geophysics}, - journal = {Computers and Geosciences}, - volume = {109}, - pages = {106--123}, - year = {2017}, - doi = {10.1016/j.cageo.2017.07.011}, - url = {https://www.sciencedirect.com/science/article/pii/S0098300417300584}, - author = {R\"ucker, C. and G\"unther, T. and Wagner, F. M.} - } diff --git a/CMakeLists.txt b/CMakeLists.txt index 158687aa5..91b027a0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -668,17 +668,6 @@ if (SPHINX_FOUND AND NOT SKIP_SPHINX) add_subdirectory(doc EXCLUDE_FROM_ALL) message(STATUS "Search recursive for related doc files from here: " ${CMAKE_SOURCE_DIR}) - file(GLOB DOCFILES LIST_DIRECTORIES false - RELATIVE "${CMAKE_SOURCE_DIR}" - "*.rst") - message(STATUS "DOCFILES: " ${DOCFILES}) - - file(GLOB DFILES LIST_DIRECTORIES false - RELATIVE "${CMAKE_SOURCE_DIR}" - "*.md") - message(STATUS "MDFILES: " ${DFILES}) - list(APPEND DOCFILES ${DFILES}) - set (RECDOCTYPES "*.rst" "*.md" "*.png" "*.svg" "*.bib" "paper/*.py") foreach (DTYPE ${RECDOCTYPES}) @@ -689,27 +678,6 @@ if (SPHINX_FOUND AND NOT SKIP_SPHINX) message(STATUS "Append DOC files: (${DTYPE}) " ${DFILES}) list(APPEND DOCFILES ${DFILES}) endforeach() - # message(STATUS "RSTFILES: " ${DFILES}) - - # file(GLOB_RECURSE DFILES LIST_DIRECTORIES false - # RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" "./doc/*.md") - # message(STATUS "MDFILES: " ${DFILES}) - # list(APPEND DOCFILES ${DFILES}) - - # file(GLOB_RECURSE DFILES LIST_DIRECTORIES false - # RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" "./doc/*.png") - # message(STATUS "PNGFILES: " ${DFILES}) - # list(APPEND DOCFILES ${DFILES}) - - # file(GLOB_RECURSE DFILES LIST_DIRECTORIES false - # RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" "./doc/*.bib") - # message(STATUS "BIBFILES: " ${DFILES}) - # list(APPEND DOCFILES ${DFILES}) - - # file(GLOB_RECURSE PYFILES LIST_DIRECTORIES false - # RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" "doc/paper/*.py") - # message(STATUS "PYFILES: " ${PYFILES}) - # list(APPEND DOCFILES ${PYFILES}) set(RSTFILES ${DOCFILES} CACHE INTERNAL "RST source file that we need to copy") diff --git a/COPYING.rst b/COPYING.rst deleted file mode 100644 index ba8230c06..000000000 --- a/COPYING.rst +++ /dev/null @@ -1,204 +0,0 @@ -License -======= - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 000000000..5f8f15d7a --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1,197 @@ +(installation)= +# Installation + +```{raw} html +

+ + + + + + + + + + + + + + +


+``` + +On all platforms, we recommend to install pyGIMLi via the conda package manager +contained in the Anaconda Python distribution. For details on how to install +Anaconda, see [this page](https://docs.anaconda.com/anaconda/install/). + +Note that Anaconda comes with many (great) packages, many of which you likely +will not use. If you want to save space, you can install the [light-weight +version Miniconda](https://docs.anaconda.com/free/miniconda/miniconda-install/). + +:::{note} +After installing Anaconda or Miniconda, make sure that you have at least +version 23.10.0 of conda (`conda --version`). +::: + +% TODO: Temporarily disabled. PDF needs to update version automatically. + +% A **step-by-step guide for Windows users** can be found `here + +% `_. + +To avoid conflicts with other packages, we recommend to install pyGIMLi in a +separate environment. Here we call this environment `pg`, but you can give +it any name. Note that this environment has to be created only once. + +Open a terminal (Linux & Mac) or the Anaconda Prompt (Windows) and type: + +```bash +conda create -n pg -c gimli -c conda-forge "pygimli>=1.5.0" +``` + +If you want to use pyGIMLi from the command line, you have to activate the +environment. You can put this line in your `~/.bashrc` file so that it is +activated automatically if you open a terminal. + +```bash +conda activate pg +``` + +After that you can use pyGIMLi with your text editor of choice and a terminal. + + +## Using pip + +*Currently only available for linux and windows.* + +pyGIMLi can be also installed using the default python installer using `pip`. If you don't use a conda environment we encurage the use of a virtual environment. + +```bash +python -m venv .venv --promp=pg +.venv/bin/activate # for linux +#or for windows +.venv/Scripts/activate +``` +Its maybe not a bad idea to keep evironments if you have a working toolchain and test new pygimli version in a new virtual environment first. + + +To install pygimli using `pip`: + +```bash +pip install pygimli +``` + +To update pygimli using `pip`: + +```bash +pip install -U pygimli +``` + +Find available version: + +```bash +pip index versions pygimli +``` + +To install a specific version using `pip`: + +```bash +pip install pygimli==$version +``` + + +## Usage with Spyder or JupyterLab + +Depending on your preferences, you can also install third-party software such as +the MATLAB-like integrated development environment (): + +```bash +conda install -c conda-forge spyder +``` + +Or alternatively, the web-based IDE JupyterLab (): + +```bash +conda install -c conda-forge jupyterlab +``` + +If you do one of the above steps in the `pg` environment, then it will +automatically find pyGIMLi. But you may not want to install JupyterLab or +Spyder for every different environment. To use your existing JupyterLab +installation in the `base` environment with pyGIMLi in the `pg` environment, +follow these steps: + +```bash +conda activate pg +conda install ipykernel +conda activate base +conda install -c conda-forge nb_conda_kernels +jupyter lab +``` + +## pyGIMLi on Google Colab + +Even though still experimental, pyGIMLi can be run on Google Colab without any +installation on your own computer. Just create a new Notebook and install the +pyGIMLi package via pip: + + !pip install pygimli tetgen + +It turns out that there are some packages preinstalled that lead to some +incompatibl numpy version, so you might have to uninstall them first. + +.. code:: python + + !pip uninstall -y numba tensorflow pytensor thinc + !pip install pygimli tetgen + +## Staying up-to-date + +Update your pyGIMLi installation from time to time, if want to have the newest +functionality. + +```bash +conda update -c gimli -c conda-forge pygimli +``` + +If something went wrong and you are running an old, not further +supported Python version, consider a fresh install in a new clean environment. +The only drawback of using conda is that you are bound to the rhythm in which we +update the conda packages. In order to work with the latest Python codes you +should create an environment with the latest pyGIMLi C++ core only, + +```bash +conda create -n pgcore -c gimli -c conda-forge pgcore +``` + +retrieve the source code by git + +```bash +git clone https://github.com/gimli-org/gimli +cd gimli +``` + +and install pygimli as a development package using conda + +```bash +conda develop . +``` + +or using pip + +```bash +pip install --no-build-isolation --no-deps -e . +``` + +Alternatively you could set the `PYTHONPATH` variable, but you would have to care +for dependencies by yourself. + +Later you can just update the pyGIMLi code by + +```bash +git pull +``` + +Only if you need recent changes to the C++ core, you have to compile +pyGIMLi using your systems toolchain as described in + diff --git a/INSTALLATION.rst b/INSTALLATION.rst deleted file mode 100644 index 026270a04..000000000 --- a/INSTALLATION.rst +++ /dev/null @@ -1,158 +0,0 @@ -Installation -============ - -.. raw:: html - -

- - - - - - - - - - - - - - -


- - -On all platforms, we recommend install pyGIMLi via the conda package manager -and the cleanest way is to create a new environment. -Besides large installers like `Anaconda `_ -that come with many (great) packages, you can save space and install a -light-weight installer like -`Miniconda `_ -or `Miniforge `_. - -.. note:: - - After installing Anaconda or Miniconda, make sure that you have at least - version 23.10.0 of conda (`conda --version`). - -.. TODO: Temporarily disabled. PDF needs to update version automatically. -.. A **step-by-step guide for Windows users** can be found `here -.. `_. - -To avoid conflicts with other packages, we recommend to install pyGIMLi in a -separate environment. Here we call this environment `pg`, but you can give -it any name. Note that this environment has to be created only once. - -Open a terminal (Linux & Mac) or the Anaconda Prompt (Windows) and type: - -.. code-block:: bash - - conda create -n pg -c gimli -c conda-forge "pygimli>=1.5.0" - -If you want to use pyGIMLi from the command line, you have to activate the -environment. You can put this line in your `~/.bashrc` file so that it is -activated automatically if you open a terminal. - -.. code-block:: bash - - conda activate pg - -After that you can use pyGIMLi with your text editor of choice and a terminal. - -Usage with Spyder or JupyterLab -------------------------------- - -Depending on your preferences, you can also install third-party software such as -the MATLAB-like integrated development environment (https://www.spyder-ide.org): - -.. code-block:: bash - - conda install -c conda-forge spyder - -Or alternatively, the web-based IDE JupyterLab (https://jupyterlab.readthedocs.io): - -.. code-block:: bash - - conda install -c conda-forge jupyterlab - -If you do one of the above steps in the `pg` environment, then it will -automatically find pyGIMLi. But you may not want to install JupyterLab or -Spyder for every different environment. To use your existing JupyterLab -installation in the `base` environment with pyGIMLi in the `pg` environment, -follow these steps: - -.. code-block:: bash - - conda activate pg - conda install ipykernel - conda activate base - conda install -c conda-forge nb_conda_kernels - jupyter lab - -pyGIMLi on Google Colab ------------------------ -pyGIMLi can be run on Google Colab without any installation on your own -computer. Just create a new Notebook and install pyGIMLi via pip: - -.. code:: python - - !pip install pygimli tetgen - -It turns out that there are some packages preinstalled that lead to some -incompatibl numpy version, so you might have to uninstall them first. - -.. code:: python - - !pip uninstall -y numba tensorflow pytensor thinc - !pip install pygimli tetgen - -Staying up-to-date ------------------- - -Update your pyGIMLi installation from time to time, if want to have the newest -functionality. - -.. code-block:: bash - - conda update -c gimli -c conda-forge pygimli - -If there something went wrong and you are running an old, not further -supported python version, consider a fresh install in a new clean environment. -The only drawback of using conda is that you are bound to the rhythm in which we -update the conda packages. In order to work with the latest Python codes you -should create an environment with the latest pyGIMLi C++ core only, - -.. code-block:: bash - - conda create -n pgcore -c gimli -c conda-forge pgcore - -retrieve the source code by git - -.. code-block:: bash - - git clone https://github.com/gimli-org/gimli - cd gimli - -and install pygimli as a development package using conda - -.. code-block:: bash - - conda develop . - -or using pip - -.. code-block:: bash - - pip install --no-build-isolation --no-deps -e . - -Alternatively you could set the PYTHONPATH variable but you would have to care -for dependencies by yourself. - -Later you can just update the pygimli code by - -.. code-block:: bash - - git pull - -Only if you need recent changes to the C++ core, you have to compile -pyGIMLi using your systems toolchain as described in -https://www.pygimli.org/compilation.html#sec-build diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index a8f004931..000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,36 +0,0 @@ -### Problem description - -Please describe your issue here. - -### Your environment - -Please provide the output of `print(pygimli.Report())` here. If that does not -work, please give provide some additional information on your: - -**Operating system**: e.g. Windows, Linux or Mac? -**Python version**: e.g. 3.9, 3.10, etc.? -**pyGIMLi version**: Output of `print(pygimli.__version__)` -**Way of installation**: e.g. Conda package, manual compilation from source, etc. - -### Steps to reproduce - -Tell us how to reproduce this issue. Ideally, you could paste the code that produces the error: - -```python -import pygimli as pg -... -``` - -### Expected behavior - -Tell us what should happen or what you want to achieve. - -### Actual behavior - -Tell us what happens instead and/or provide the output of your script. - -``` -Paste your script output here. -``` - -> If possible, please add one or more labels to your issue, e.g. if you expect that your issue is rather a question than a problem with the code, please add the label "question". \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..c5bb2d296 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,203 @@ +# License + +> Apache License +> Version 2.0, January 2004 +> http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.rst b/README.rst deleted file mode 100644 index 5598c070d..000000000 --- a/README.rst +++ /dev/null @@ -1,107 +0,0 @@ -About pyGIMLi -============= - -Introduction ------------- - -pyGIMLi is an open-source library for -:ref:`modelling` and -:ref:`inversion` and in geophysics. The -object-oriented library provides management for structured and unstructured -meshes in 2D and 3D, finite-element and finite-volume solvers, various -geophysical forward operators, as well as Gauss-Newton based frameworks for -constrained, joint and fully-coupled inversions with flexible regularization. - -What is pyGIMLi suited for? - -* analyze, visualize and invert geophysical data in a reproducible manner -* forward modelling of (geo)physical problems on complex 2D and 3D geometries -* inversion with flexible controls on a-priori information and regularization -* combination of different methods in constrained, joint and fully-coupled inversions -* teaching applied geophysics (e.g. in combination with `Jupyter notebooks `_) - -What is pyGIMLi **NOT** suited for? - -* for people that expect a ready-made GUI for interpreting their data - -.. _sec:authors: - -Authors -------- - -.. raw:: html - -

- - - -

- -.. .. image:: https://img.shields.io/github/contributors/gimli-org/gimli.svg?style=flat-square - :target: https://github.com/gimli-org/gimli/graphs/contributors - -We gratefully acknowledge all contributors to the pyGIMLi open-source project and look forward to `your contribution `_! - -.. include:: ../AUTHORS.rst - -.. _sec:about_gimli_inversion: - -Inversion ---------- - -One main task of pyGIMli is to carry out inversion, i.e. error-weighted -minimization, for given forward routines and data. Various types of -regularization on meshes (1D, 2D, 3D) with regular or irregular arrangement are -available. There is flexible control of all inversion parameters. The default -inversion framework is based on the generalized Gauss-Newton method. - -Please see :ref:`tut:inversion` for examples and more -details. - -.. _sec:about_gimli_modelling: - -Modelling ---------- - -pyGIMLi comes with various geophysical forward operators, which can directly be -used for a given problem. In addition, abstract finite-element and finite-volume -interfaces are available to solve custom PDEs on a given mesh. See -:mod:`pygimli.physics` for a collection of forward operators and -:mod:`pygimli.solver` for the solver interface. - -The modelling capabilities of pyGIMLi include: - -* 1D, 2D, 3D discretizations -* linear and quadratic shape functions (automatic shape function generator for possible higher order) -* Triangle, Quads, Tetrahedron, Prism and Hexahedron, mixed meshes -* solver for elliptic problems (Helmholtz-type PDE) - -Please see :ref:`tut:modelling` for examples and more details. - -License -------- -pyGIMLi is distributed under the terms of the **Apache 2.0** license. Details on -the license agreement can be found `here -`_. - - -Credits -------- - -We use or link some third-party software (beside the usual tool stack: cmake, gcc, boost, python, numpy, scipy, matplotlib) and are grateful for all the work made by the authors of these awesome open-source tools: - -* libkdtree++: Maybe abandoned, mirror: https://github.com/nvmd/libkdtree - -* meshio: https://github.com/nschloe/meshio - -* pyplusplus: https://pypi.org/project/pyplusplus/ - -* pyvista: https://docs.pyvista.org/ - -* suitesparse, umfpack: https://people.engr.tamu.edu/davis/suitesparse.html - -* Tetgen: http://wias-berlin.de/software/index.jsp?id=TetGen&lang=1 - -* Triangle: https://www.cs.cmu.edu/~quake/triangle.html - - diff --git a/core/src/regionManager.cpp b/core/src/regionManager.cpp index 9900fa92e..c1f99da9c 100644 --- a/core/src/regionManager.cpp +++ b/core/src/regionManager.cpp @@ -494,7 +494,7 @@ void Region::fillBoundarySize(RVector & vec, Index boundStart){ void Region::setTransModel(Trans< RVector > & tM){ if (isBackground_){ - // log(Warning, "Region Nr:", marker_, " is background and should not get a model transformation."); + // log(Warning, "Region Nr:", marker_, " is background and should not get a model transformation."); return; } @@ -506,7 +506,7 @@ void Region::setTransModel(Trans< RVector > & tM){ void Region::setModelTransStr_(const std::string & val){ if (isBackground_){ - // log(Warning, "Region Nr:", marker_, " is background and should not get a model transformation."); + // log(Warning, "Region Nr:", marker_, " is background and should not get a model transformation."); return; } transString_ = val; @@ -613,6 +613,7 @@ void RegionManager::clear(){ if (mesh_) { delete mesh_; mesh_ = NULL; } } + void RegionManager::setMesh(const Mesh & mesh, bool holdRegionInfos){ if (!holdRegionInfos){ @@ -633,7 +634,7 @@ void RegionManager::setMesh(const Mesh & mesh, bool holdRegionInfos){ mesh_->createNeighborInfos(); if (verbose_) { std::cout << swatch.duration(true) << " s " << std::endl; - std::cout << "analysing mesh ... "; + std::cout << "analyzing mesh ... "; } //** looking for and create regions @@ -644,7 +645,7 @@ void RegionManager::setMesh(const Mesh & mesh, bool holdRegionInfos){ bool singleOnly = false; if (regions.size() > 50){ singleOnly = true; - log(Info,"More than 50 regions, so we assume single regions only."); + log(Info, "More than 50 regions, so we assume single regions only."); } std::map < int, std::vector< Cell * > > markerCellVectorMap; @@ -707,6 +708,7 @@ Region * RegionManager::createRegion_(SIndex marker, const Mesh & mesh, SIndex c Region * region = NULL; if (regionMap_.count(marker) == 0){ + // __MS(marker) region = new Region(marker, mesh, cellMarker, this); regionMap_.insert(std::make_pair(marker, region)); } else { @@ -946,7 +948,7 @@ void RegionManager::fillConstraints(RSparseMapMatrix & C){ cID += x.second->constraintCount(); // __MS(cID) } - + // __MS(interRegionConstraints_.size()) if (interRegionConstraints_.size() > 0){ if (verbose_) std::cout << "Creating inter region constraints." << std::endl; @@ -955,9 +957,9 @@ void RegionManager::fillConstraints(RSparseMapMatrix & C){ for (auto & it : this->interRegionConstraints_){ std::pair< SIndex, SIndex > ab = it.first; - + double cWeight = it.second; - + // if (verbose_) { // std::cout << "\t" << i << ": " // << ab.first << "< (" << cWeight << ") >" diff --git a/dependencies.rst b/dependencies.rst deleted file mode 100644 index 669357fe7..000000000 --- a/dependencies.rst +++ /dev/null @@ -1,53 +0,0 @@ -.. _sec:install_pre: - -Prerequisites -------------- - -To build pyGIMLi from source, the following tools are required: - -* subversion, git, mercurial, wget, tar -* cmake >= 2.8.10 -* gcc >= 4.4 -* >=Python-3.5 | >=Python-2.7 -* numpy-dev -* >=matplotlib-3.0 -* >=clang++-3.6.0 (3.7.0, 3.8.0) -* libclang-3.7-dev -* >=llvm-3.6.0 (3.7.0, 3.8.0) -* libz-dev -* python-setuptools - - tested on: - - * gentoo x86_64: gcc-4.4.5, gcc-4.5.3, gcc-4.5.4, gcc-4.9.2 gcc-5.3.0 - * Debian 3.2.46-1 x86_64: gcc-4.7.2 - * Ubuntu 16.04 LTS with gcc-5.4.0 - * Arch Linux gcc-5.2.0 - * CentOS - * MinGW32: gcc-4.6.2/4, gcc-4.7.2, gcc-5.2.0 - * MinGW64: gcc-4.5.4, gcc-5.2.0, gcc-6.3.0, gcc-7.1.0 - -Optional Prerequisites -...................... - -These tools can be installed system-wide with your native package manager (i.e. -apt-get). If not found, the provided build scripts will automatically download -and compile the necessary components. - -* libboost >=1.46 (python) (1.46, 1.48, 1.49, 1.51, 1.52, 1.53, 1.57) -* blas and lapack for suitesparse (system or auto via cmake) -* SuiteSparse (http://faculty.cse.tamu.edu/davis/suitesparse.html) -* cppunit -* procps -* triangle (http://www.cs.cmu.edu/~quake/triangle.html) - -Prerequisites automatically installed by the installer -...................................................... - -These tools are required to create the Python bindings and are likely to be -outdated in your distribution and should therefore not be installed -system-wide. The build scripts will install them automatically. - -* castxml -* pygccxml -* pyplusplus diff --git a/dev_requirements.txt b/dev_requirements.txt index ab00d4b6d..b77416151 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -18,10 +18,6 @@ pygccxml==2.5.0 # needed to run matplotlib>=3.7,<3.9 -# useful to run -ipython -jupytext - # optional, but strongly recommended #scipy<1.14 # for numpy 1 scipy>=1.14 # for numpy 2 @@ -31,7 +27,7 @@ pyvista[all]>=0.44 # for numpy 2 pyqt5 tqdm -# needed to build docu +# needed to build docu (after doc reworks) sphinx>=3.1 sphinxcontrib-bibtex sphinxcontrib-programoutput @@ -40,8 +36,15 @@ sphinx-gallery sphinx-design pydata-sphinx-theme bibtexparser +jupytext +myst_nb +linkify-it-py + +# optional, but strongly recommended +scooby +ipython -# needed for testing +# for testing pytest meshio diff --git a/doc/BUILD_LINUX.rst b/doc/BUILD_LINUX.rst index ff67f33d9..53ff99f8b 100644 --- a/doc/BUILD_LINUX.rst +++ b/doc/BUILD_LINUX.rst @@ -51,6 +51,7 @@ tweaking** Curl installer .............. +(Probably outdated.) If you are not using Anaconda, you can build pyGIMLi from source in the current directory via: diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 088a7bf10..1a1107ef3 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -95,7 +95,7 @@ add_custom_target(sphinxhtml ALL ${SPHINX_EXECUTABLE} -v -D abort_on_example_error=1 -T - -b html + -b dirhtml -c "${SPHINX_BUILD_DIR}/doc" -d "${SPHINX_CACHE_DIR}/html" "${SPHINX_BUILD_DIR}/doc" @@ -116,7 +116,7 @@ add_custom_target(sphinxhtml-nogallery ALL -D abort_on_example_error=1 -D plot_gallery=0 -T - -b html + -b dirhtml -c "${SPHINX_BUILD_DIR}/doc" -d "${SPHINX_CACHE_DIR}/html" "${SPHINX_BUILD_DIR}/doc" diff --git a/doc/Makefile b/doc/Makefile index a5a297a29..988c304cb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -44,7 +44,7 @@ help: @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" -auto: api +auto: # Used to auto-update website in local build. Requires sphinx-autobuild. sphinx-autobuild --delay 2 --ignore "pygimliapi/*" --ignore "pygimliapi/_generated/*" --ignore "*gallery.html" --ignore "*.examples" --ignore "*.ipynb" --ignore "*.zip" --ignore "*.pickle" . _build/html -D plot_gallery=0 @@ -68,12 +68,12 @@ gallery: python ./sidebar_gallery.py html-nogallery: api - $(SPHINXBUILD) -D plot_gallery=0 -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -D plot_gallery=0 -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished without gallery. The HTML pages are in $(BUILDDIR)/html." html: api - $(SPHINXBUILD) -v -D abort_on_example_error=True -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -v -D abort_on_example_error=True -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @@ -82,11 +82,6 @@ spelling: api @echo @echo "Spellcheck finished." -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @@ -103,7 +98,7 @@ json: @echo "Build finished; now you can process the JSON files." htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + $(SPHINXBUILD) -b dirhtmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." @@ -180,3 +175,7 @@ pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +serve: + cd $(BUILDDIR)/html + python -m http.server diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css index a683e5259..23be5cdf4 100644 --- a/doc/_static/css/custom.css +++ b/doc/_static/css/custom.css @@ -186,4 +186,8 @@ table.doc-index td, table th { [data-theme=dark] .bd-header-announcement { background: #7a7d16; + } + +.xref.std.std-ref { + visibility: hidden; } \ No newline at end of file diff --git a/doc/_templates/navbar-nav.html b/doc/_templates/navbar-nav.html deleted file mode 100644 index 9bdadc62e..000000000 --- a/doc/_templates/navbar-nav.html +++ /dev/null @@ -1,25 +0,0 @@ - \ No newline at end of file diff --git a/doc/_templates/sidebar.html b/doc/_templates/sidebar.html index 2e74cd136..56ba76b8f 100644 --- a/doc/_templates/sidebar.html +++ b/doc/_templates/sidebar.html @@ -22,7 +22,7 @@