grav-toolbox


Namegrav-toolbox JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/ahellers/GravTools
SummaryGravity survey utility tools
upload_time2024-07-24 20:13:27
maintainerNone
docs_urlNone
authorAndreas Hellerschmied
requires_pythonNone
licenseGNU GPLv3
keywords gravity gravimeter least squares adjustment geodesy geophysics
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GravTools
GravTools is an open source software toolbox for processing relative gravity surveys developed at the Austrian
Federal Office of Metrology and Surveying (BEV).  

 - The source code is hosted on github.com: https://github.com/ahellers/GravTools
 - The python package is hosted at: https://pypi.org/project/grav-toolbox/

# Installation

## Install python package with pip:
`pip install grav-toolbox`

### Optional dependency for GIS data export
GravTools allows to export station- und observation-results to shapefiles for import and analysis in GIS programs.
To enable these features the optional package "geopandas" needs to be installed by executing:
`pip install grav-toolbox[gis]`
 
## Installation issues on Centos 8:
* **1. Carry out installation steps describes above** 
* **2. Install QT5, if required**
  * `sudo yum install qt5-qtbase-devel.x86_64`
  
## Installation issues on Ubuntu 20.04:
After just installing PyQt5 with pip3 the following error occurred when trying to actually run a PyQt GUI: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This issue was resolved by installing the QT dev tools (Designer, etc.): 
`sudo apt-get install qttools5-dev-tools`

## Test installation
In a virtual environment.

* Editable installation with pip: `pip install -e .`
  * Or: `make test_pack`
* Uninstall: `pip uninstall grav-toolbox`
  * Or: `test_pack_uninstall`

# Packaging
With setuptools and the build package.

## Create a source and binary distribution (sdist and wheel)
* Set up setup.cfg and pyproject.toml in the project root directory
* With make and the predefined makefile: `make build`
* Without make: `python3 -m build`

The created package (wheel and source distribution) is located in the "dist" directory.

## Push package to pypi.org
Define user credentials in /home/.pypirc

* `twine upload --verbose dist/*` or
* `make pypi_push`


# Create a stand-alone Windows executable
For creating a Windows executable (stand-alone application, without python installation) the 
package "auto-py-to-exe" can be used (see: https://pypi.org/project/auto-py-to-exe/). This is a 
simple graphical user interface (based on the chrome browser) that allows to define all settings 
for the package "PyInstaller" (see: https://www.pyinstaller.org/). 

Creating a Windows executable with auto-py-to-exe was tested on Windows 10. 
Follow these steps to create an executable on a Windows machine:
* **1. Install Python3**
  * With installer from https://www.python.org/downloads/windows/
  * Add python3.x to the Windows search path and install pip!
* **2. Install virtualenv and create a virtual environment** in CMD
  * a. `pip install virtualenv`
  * b. Change to project directory (`cd ..`)
  * c. Create virtual environment: `virtualenv env`
  * d. Activate it: `env\Scripts\activate.bat`
    * Deactivate with `deactivate`
* **3. Install gravtools**: `pip install gravtools[gis]`
* **4. Install auto-py-to-exe**: `pip install auto-py-to-exe`
* **5. Try to run the GravTools**
  * Type `gt` in the command line interface (virtual environment must be active)
* **6. Create exe with auto-py-to-exe**
  * Run the CMD Window as administrator!
  * a. Start auto-py-to-exe in CMD: `auto-py-to-exe`
  * b. Select the script location (select: gravtools/scripts/run_gui.py)
  * c. Select "One File" and "Console based" (in addition to teh GUI a console will appear)
  * d. Start conversion py pressing the big blue button on the GUI bottom
  * e. The exe file will be save at a new "output" directory. Move the file to: "Windows_executables"

# Create HTML documentation with sphinx:
Sphinx is used to create an API documentation based on docstrings. Run make in the gravtools/doc directory: 
* `>>>make html_doc`

# Guidelines and conventions

## Code style:
* Respect the PEP conventions on python coding!
  * PEP 8 -- Style Guide for Python Code: https://www.python.org/dev/peps/pep-0008/
* The maximum line length is 120 characters
* Use **type hints**: https://www.python.org/dev/peps/pep-0484/
* Use docstrings according to the numpy standard: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
  * They are useful to generate the documentation automatically
  * Example: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
* Comment code, if necessary!
* Use English language for the code, docstrings and comments

## Documentation and docstring style
* The API reference is created with sphinx (https://www.sphinx-doc.org/).
* Docstrings have to follow the numpy standard, see: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
  * Examples: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
  * Contrary to the numpy standard license and copyright information is provided at least in the package and module docstrings.
* Package documentation via docstring in __ini__.py files
* Module documentation via docstring at first lines of py-file
* Documentation of classes, class methods and functions via docstrings
  
## Command line interface and executable scripts
* The command line interface is realized via entry points (console_scripts) in setuptools (python packaging tool)
  * Input arguments are handled with argparse
* Executable scripts are located in gravtools/scripts
  

# License and copyright

Copyright (C) 2021  Andreas Hellerschmied (<andreas.hellerschmied@bev.gv.at>)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ahellers/GravTools",
    "name": "grav-toolbox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "gravity, gravimeter, least squares adjustment, geodesy, geophysics",
    "author": "Andreas Hellerschmied",
    "author_email": "andreas.hellerschmied@bev.gv.at",
    "download_url": "https://files.pythonhosted.org/packages/04/5b/e82fb1e6b2a33efabe86b1db7e58f9db04ba20066b5d81eefda2509ab609/grav_toolbox-0.3.0.tar.gz",
    "platform": null,
    "description": "# GravTools\nGravTools is an open source software toolbox for processing relative gravity surveys developed at the Austrian\nFederal Office of Metrology and Surveying (BEV).  \n\n - The source code is hosted on github.com: https://github.com/ahellers/GravTools\n - The python package is hosted at: https://pypi.org/project/grav-toolbox/\n\n# Installation\n\n## Install python package with pip:\n`pip install grav-toolbox`\n\n### Optional dependency for GIS data export\nGravTools allows to export station- und observation-results to shapefiles for import and analysis in GIS programs.\nTo enable these features the optional package \"geopandas\" needs to be installed by executing:\n`pip install grav-toolbox[gis]`\n \n## Installation issues on Centos 8:\n* **1. Carry out installation steps describes above** \n* **2. Install QT5, if required**\n  * `sudo yum install qt5-qtbase-devel.x86_64`\n  \n## Installation issues on Ubuntu 20.04:\nAfter just installing PyQt5 with pip3 the following error occurred when trying to actually run a PyQt GUI: qt.qpa.plugin: Could not load the Qt platform plugin \"xcb\" in \"\" even though it was found.\nThis issue was resolved by installing the QT dev tools (Designer, etc.): \n`sudo apt-get install qttools5-dev-tools`\n\n## Test installation\nIn a virtual environment.\n\n* Editable installation with pip: `pip install -e .`\n  * Or: `make test_pack`\n* Uninstall: `pip uninstall grav-toolbox`\n  * Or: `test_pack_uninstall`\n\n# Packaging\nWith setuptools and the build package.\n\n## Create a source and binary distribution (sdist and wheel)\n* Set up setup.cfg and pyproject.toml in the project root directory\n* With make and the predefined makefile: `make build`\n* Without make: `python3 -m build`\n\nThe created package (wheel and source distribution) is located in the \"dist\" directory.\n\n## Push package to pypi.org\nDefine user credentials in /home/.pypirc\n\n* `twine upload --verbose dist/*` or\n* `make pypi_push`\n\n\n# Create a stand-alone Windows executable\nFor creating a Windows executable (stand-alone application, without python installation) the \npackage \"auto-py-to-exe\" can be used (see: https://pypi.org/project/auto-py-to-exe/). This is a \nsimple graphical user interface (based on the chrome browser) that allows to define all settings \nfor the package \"PyInstaller\" (see: https://www.pyinstaller.org/). \n\nCreating a Windows executable with auto-py-to-exe was tested on Windows 10. \nFollow these steps to create an executable on a Windows machine:\n* **1. Install Python3**\n  * With installer from https://www.python.org/downloads/windows/\n  * Add python3.x to the Windows search path and install pip!\n* **2. Install virtualenv and create a virtual environment** in CMD\n  * a. `pip install virtualenv`\n  * b. Change to project directory (`cd ..`)\n  * c. Create virtual environment: `virtualenv env`\n  * d. Activate it: `env\\Scripts\\activate.bat`\n    * Deactivate with `deactivate`\n* **3. Install gravtools**: `pip install gravtools[gis]`\n* **4. Install auto-py-to-exe**: `pip install auto-py-to-exe`\n* **5. Try to run the GravTools**\n  * Type `gt` in the command line interface (virtual environment must be active)\n* **6. Create exe with auto-py-to-exe**\n  * Run the CMD Window as administrator!\n  * a. Start auto-py-to-exe in CMD: `auto-py-to-exe`\n  * b. Select the script location (select: gravtools/scripts/run_gui.py)\n  * c. Select \"One File\" and \"Console based\" (in addition to teh GUI a console will appear)\n  * d. Start conversion py pressing the big blue button on the GUI bottom\n  * e. The exe file will be save at a new \"output\" directory. Move the file to: \"Windows_executables\"\n\n# Create HTML documentation with sphinx:\nSphinx is used to create an API documentation based on docstrings. Run make in the gravtools/doc directory: \n* `>>>make html_doc`\n\n# Guidelines and conventions\n\n## Code style:\n* Respect the PEP conventions on python coding!\n  * PEP 8 -- Style Guide for Python Code: https://www.python.org/dev/peps/pep-0008/\n* The maximum line length is 120 characters\n* Use **type hints**: https://www.python.org/dev/peps/pep-0484/\n* Use docstrings according to the numpy standard: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard\n  * They are useful to generate the documentation automatically\n  * Example: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html\n* Comment code, if necessary!\n* Use English language for the code, docstrings and comments\n\n## Documentation and docstring style\n* The API reference is created with sphinx (https://www.sphinx-doc.org/).\n* Docstrings have to follow the numpy standard, see: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard\n  * Examples: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html\n  * Contrary to the numpy standard license and copyright information is provided at least in the package and module docstrings.\n* Package documentation via docstring in __ini__.py files\n* Module documentation via docstring at first lines of py-file\n* Documentation of classes, class methods and functions via docstrings\n  \n## Command line interface and executable scripts\n* The command line interface is realized via entry points (console_scripts) in setuptools (python packaging tool)\n  * Input arguments are handled with argparse\n* Executable scripts are located in gravtools/scripts\n  \n\n# License and copyright\n\nCopyright (C) 2021  Andreas Hellerschmied (<andreas.hellerschmied@bev.gv.at>)\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>.\n\n\n",
    "bugtrack_url": null,
    "license": "GNU GPLv3",
    "summary": "Gravity survey utility tools",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/ahellers/GravTools"
    },
    "split_keywords": [
        "gravity",
        " gravimeter",
        " least squares adjustment",
        " geodesy",
        " geophysics"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ee0cbe6892f85bce817c126fe7f1496f61339c394dd8bdc45e235c087a1089a",
                "md5": "85594d7a674c243ef323424c30d8ac29",
                "sha256": "3020e20077bc91652ef5cbbecef5f59f4d7c4cdb466b0dadb38dafa638b54c00"
            },
            "downloads": -1,
            "filename": "grav_toolbox-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "85594d7a674c243ef323424c30d8ac29",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 318998,
            "upload_time": "2024-07-24T20:12:59",
            "upload_time_iso_8601": "2024-07-24T20:12:59.688030Z",
            "url": "https://files.pythonhosted.org/packages/7e/e0/cbe6892f85bce817c126fe7f1496f61339c394dd8bdc45e235c087a1089a/grav_toolbox-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "045be82fb1e6b2a33efabe86b1db7e58f9db04ba20066b5d81eefda2509ab609",
                "md5": "c3afb56f5148148e2fb76537409cbcc5",
                "sha256": "7a29d52988d920f80083eb640e12e27916634fc8954e4fe0d25447f9d8c5351e"
            },
            "downloads": -1,
            "filename": "grav_toolbox-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c3afb56f5148148e2fb76537409cbcc5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 262170,
            "upload_time": "2024-07-24T20:13:27",
            "upload_time_iso_8601": "2024-07-24T20:13:27.162773Z",
            "url": "https://files.pythonhosted.org/packages/04/5b/e82fb1e6b2a33efabe86b1db7e58f9db04ba20066b5d81eefda2509ab609/grav_toolbox-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-24 20:13:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ahellers",
    "github_project": "GravTools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "grav-toolbox"
}
        
Elapsed time: 3.42324s