pyvstress


Namepyvstress JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://gitlab.com/geosharma/pyvstress
SummaryA minimal code to compute vertical stresses in horizontal soil profile.
upload_time2023-09-06 00:01:32
maintainer
docs_urlNone
authorAashish Sharma
requires_python>=3.11,<4.0
license GPL-3.0-or-later
keywords soil mechanics geotechnical engineering vertical stresses soil profile
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Rudimentary soil model primarily for vertical stresses under level ground.
Define soil layers, assemble them into soil profile and compute total vertical stresses, pore pressures, and effective vertical stresses at specified locations beneath a level ground. In addition, return requested soil parameters at specified depths. One can use these parameters at specified depths to perform futher analysis. This is a work in progress.

## Documentation
[pyvstress documentation](https://pyvstress.readthedocs.io/en/latest/)


## References:
 - [Maxim Millen's eng-tools](https://github.com/eng-tools)
 - [Nico Schlömer and others pygmsh](https://github.com/nschloe/pygmsh)
 - [Albert Kottke's pysra](https://github.com/arkottke/pysra)
 - [note.nkmk.me](https://note.nkmk.me/en/python-pip-install-requirements/)

## Usage
Sorry for the lack of documentation. I am in the process of learning how to create documentation from python docstrings. I am a slow learner so I do not know when that will be ready. Once that is up, maybe I will include few examples in the documentation. Untill then please refer to the `tests` and the `examples` folders. 

## Requirements
There is a *requirements.txt* file which was generated using `pipreqs`. The version number may not be very important. Only Python and Numpy are required for the package:
 - python: the latest version, most probably 3.10, but version number may not be too important
 - numpy

If you have a `.venv` virtual environment, `pipreqs` returns a bunch of packages. In such cases use `--ignore .venv`.

```
pipreqs ./ --ignore .venv
```
Use `--force` if *requirement.txt* already exists.

However, these additional packages are required to run the example files and tests with `pytest`.
 - pandas
 - matplotlib
 - altair
 - hancalcs
 - pytest

# Project folder
pyvstress (Package root directory)
├── build
├── dist
├── docs
├── examples
├── LICENSE.md
├── pyproject.toml
├── pyvstress
    ├── __about__.py
    ├── exceptions.py
    ├── __init__.py
    ├── __pycache__
    ├── soil.py
    └── utility_functions.py
├── pyvstress.egg-info
├── README.md
├── requirements.txt
└── tests


# Local installation in virtual environment
1. Make a `.venv` directory in the project folder.
2. Make a virtual environment `python -m venv .venv`
3. Activate the virtual environment `source .venv/bin/activate`
4. Install the requirements `python -m pip install -r requirements.txt`
5. Install the package locally `pip install -e .`

Above (4) and (5) are run after activating the virtual environment. This will install the package to the virtual environment. Any changes your make to the source code will be reflected in the package.

# Build system
Creater a `pyproject.toml` file. Refer to `Setuptools` [Quickstart Userguide](https://setuptools.pypa.io/en/latest/userguide/quickstart.html)

- Place a `pyproject.toml` in the root directory of the project. Check the file for this package in the project root directory.

- Install `setuptools` and `build` using `pip` in the virtual environment `.venv`.

- Run `python -m build` in the package root directory. This will create `.whl` and `.tar.gz` in the `/build` directory for distribution. 


## Upload to online repository with twine

- To upload to pypi, `twine upload` 

- To upload to TestPyPi `twine upload --repository testpypi dist/*`


## Installation

I have a version uploaded to pypi `pip install pyvstress`

If installing packages from TestPyPi then `$ pip install --index-url https://test.pypi.org/simple/packagename`

## Publishing
The documentation is created using the docstrings with Sphinx and published at [Read the docs](https://readthedocs.org/).

1. Install `sphinx` and `sphinx-rtd-theme`, in the same environment in which you are building your package. That means you have to be in the virtural environment e.g. `source .venv\bin\activate`

```
pip install sphinx
pip install sphinx-rtd-theme
```

2. Create `docs` directory in your package directory to hold the documentation files.
```mkdir docs```

3. Run `sphinx-quickstart` in the `docs` folder. Provide the information and when asked about creating a separate folder for build type `y`.

```cd docs
sphinx-quickstart
```
The `docs` folder will have
```
build
source
Makefile
make.bat
```
Within the `source` folder there will be two files:

```
conf.py
index.rst
```
4. Run the Sphinx API documentation command `sphinx-apidoc` to generate Sphinx source files.
```
[user@host docs]$ sphinx-apidoc -o source/ ../pyvstress
```
5. Edit the `conf.py` file. 
    - a. Change the `html_theme` to the one of your liking, `html_theme = 'sphinx_rtd_theme`.
    - b. For autocode generattion from docstrings in the code, specifiy the directory of source code.
    ```
    import os
    import sys
    sys.path.insert(0, os.path.abspath('../../pysoil/'))
    ``` 
    - c. Also add some extensions
    ```
    extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']
    ```
6. Run `make htlm`, which builds the `htlm` files in the `build/` directory.

7. Log into `ReadTheDocs` and click on `Import Project`. Fill out the fields. For the repository URL use `https://gitlab.com/geosharma/pyvstress.git`. This can be got from `CLONE -> Clone with HTPPS` URL.

8. Then in `Projects -> Admin -> Integration`, click on `Add Integration` and choose `GitLab incoming webhook`.

9. Then copy the URL starting with `readthedocs.org/api/v2/webhook/...../......` and paste it into GitLab Project `Settings -> Webhooks` 
References:
 - [Read the docs](https://readthedocs.org/)
 - [Sphinx-RTD-Tutorial](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/index.html)
 - [A idiot's guide to Python documentation with Sphinx and ReadTheDocs](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/)
 - [Read the Docs VSC Integration](https://docs.readthedocs.io/en/stable/integrations.html#github)
 - [Deplyoing a Sphinx project online](https://www.sphinx-doc.org/en/master/tutorial/deploying.html)
 - [Making Readthedocs for a Python package](https://pennyhow.github.io/blog/making-readthedocs/)
 - [An introduction to Sphinx and Read the Docs for Technical Writers](https://www.ericholscher.com/blog/2016/jul/1/sphinx-and-rtd-for-writers/)
            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/geosharma/pyvstress",
    "name": "pyvstress",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "Soil Mechanics,Geotechnical Engineering,Vertical Stresses,Soil Profile",
    "author": "Aashish Sharma",
    "author_email": "confusionaananda@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d7/6e/0c21cd014b3912635f6f707668d955d44c6404de2e8cc83139ab2b2a641d/pyvstress-0.0.3.tar.gz",
    "platform": null,
    "description": "# Rudimentary soil model primarily for vertical stresses under level ground.\nDefine soil layers, assemble them into soil profile and compute total vertical stresses, pore pressures, and effective vertical stresses at specified locations beneath a level ground. In addition, return requested soil parameters at specified depths. One can use these parameters at specified depths to perform futher analysis. This is a work in progress.\n\n## Documentation\n[pyvstress documentation](https://pyvstress.readthedocs.io/en/latest/)\n\n\n## References:\n - [Maxim Millen's eng-tools](https://github.com/eng-tools)\n - [Nico Schl\u00f6mer and others pygmsh](https://github.com/nschloe/pygmsh)\n - [Albert Kottke's pysra](https://github.com/arkottke/pysra)\n - [note.nkmk.me](https://note.nkmk.me/en/python-pip-install-requirements/)\n\n## Usage\nSorry for the lack of documentation. I am in the process of learning how to create documentation from python docstrings. I am a slow learner so I do not know when that will be ready. Once that is up, maybe I will include few examples in the documentation. Untill then please refer to the `tests` and the `examples` folders. \n\n## Requirements\nThere is a *requirements.txt* file which was generated using `pipreqs`. The version number may not be very important. Only Python and Numpy are required for the package:\n - python: the latest version, most probably 3.10, but version number may not be too important\n - numpy\n\nIf you have a `.venv` virtual environment, `pipreqs` returns a bunch of packages. In such cases use `--ignore .venv`.\n\n```\npipreqs ./ --ignore .venv\n```\nUse `--force` if *requirement.txt* already exists.\n\nHowever, these additional packages are required to run the example files and tests with `pytest`.\n - pandas\n - matplotlib\n - altair\n - hancalcs\n - pytest\n\n# Project folder\npyvstress (Package root directory)\n\u251c\u2500\u2500 build\n\u251c\u2500\u2500 dist\n\u251c\u2500\u2500 docs\n\u251c\u2500\u2500 examples\n\u251c\u2500\u2500 LICENSE.md\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 pyvstress\n    \u251c\u2500\u2500 __about__.py\n    \u251c\u2500\u2500 exceptions.py\n    \u251c\u2500\u2500 __init__.py\n    \u251c\u2500\u2500 __pycache__\n    \u251c\u2500\u2500 soil.py\n    \u2514\u2500\u2500 utility_functions.py\n\u251c\u2500\u2500 pyvstress.egg-info\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 requirements.txt\n\u2514\u2500\u2500 tests\n\n\n# Local installation in virtual environment\n1. Make a `.venv` directory in the project folder.\n2. Make a virtual environment `python -m venv .venv`\n3. Activate the virtual environment `source .venv/bin/activate`\n4. Install the requirements `python -m pip install -r requirements.txt`\n5. Install the package locally `pip install -e .`\n\nAbove (4) and (5) are run after activating the virtual environment. This will install the package to the virtual environment. Any changes your make to the source code will be reflected in the package.\n\n# Build system\nCreater a `pyproject.toml` file. Refer to `Setuptools` [Quickstart Userguide](https://setuptools.pypa.io/en/latest/userguide/quickstart.html)\n\n- Place a `pyproject.toml` in the root directory of the project. Check the file for this package in the project root directory.\n\n- Install `setuptools` and `build` using `pip` in the virtual environment `.venv`.\n\n- Run `python -m build` in the package root directory. This will create `.whl` and `.tar.gz` in the `/build` directory for distribution. \n\n\n## Upload to online repository with twine\n\n- To upload to pypi, `twine upload` \n\n- To upload to TestPyPi `twine upload --repository testpypi dist/*`\n\n\n## Installation\n\nI have a version uploaded to pypi `pip install pyvstress`\n\nIf installing packages from TestPyPi then `$ pip install --index-url https://test.pypi.org/simple/packagename`\n\n## Publishing\nThe documentation is created using the docstrings with Sphinx and published at [Read the docs](https://readthedocs.org/).\n\n1. Install `sphinx` and `sphinx-rtd-theme`, in the same environment in which you are building your package. That means you have to be in the virtural environment e.g. `source .venv\\bin\\activate`\n\n```\npip install sphinx\npip install sphinx-rtd-theme\n```\n\n2. Create `docs` directory in your package directory to hold the documentation files.\n```mkdir docs```\n\n3. Run `sphinx-quickstart` in the `docs` folder. Provide the information and when asked about creating a separate folder for build type `y`.\n\n```cd docs\nsphinx-quickstart\n```\nThe `docs` folder will have\n```\nbuild\nsource\nMakefile\nmake.bat\n```\nWithin the `source` folder there will be two files:\n\n```\nconf.py\nindex.rst\n```\n4. Run the Sphinx API documentation command `sphinx-apidoc` to generate Sphinx source files.\n```\n[user@host docs]$ sphinx-apidoc -o source/ ../pyvstress\n```\n5. Edit the `conf.py` file. \n    - a. Change the `html_theme` to the one of your liking, `html_theme = 'sphinx_rtd_theme`.\n    - b. For autocode generattion from docstrings in the code, specifiy the directory of source code.\n    ```\n    import os\n    import sys\n    sys.path.insert(0, os.path.abspath('../../pysoil/'))\n    ``` \n    - c. Also add some extensions\n    ```\n    extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']\n    ```\n6. Run `make htlm`, which builds the `htlm` files in the `build/` directory.\n\n7. Log into `ReadTheDocs` and click on `Import Project`. Fill out the fields. For the repository URL use `https://gitlab.com/geosharma/pyvstress.git`. This can be got from `CLONE -> Clone with HTPPS` URL.\n\n8. Then in `Projects -> Admin -> Integration`, click on `Add Integration` and choose `GitLab incoming webhook`.\n\n9. Then copy the URL starting with `readthedocs.org/api/v2/webhook/...../......` and paste it into GitLab Project `Settings -> Webhooks` \nReferences:\n - [Read the docs](https://readthedocs.org/)\n - [Sphinx-RTD-Tutorial](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/index.html)\n - [A idiot's guide to Python documentation with Sphinx and ReadTheDocs](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/)\n - [Read the Docs VSC Integration](https://docs.readthedocs.io/en/stable/integrations.html#github)\n - [Deplyoing a Sphinx project online](https://www.sphinx-doc.org/en/master/tutorial/deploying.html)\n - [Making Readthedocs for a Python package](https://pennyhow.github.io/blog/making-readthedocs/)\n - [An introduction to Sphinx and Read the Docs for Technical Writers](https://www.ericholscher.com/blog/2016/jul/1/sphinx-and-rtd-for-writers/)",
    "bugtrack_url": null,
    "license": " GPL-3.0-or-later",
    "summary": "A minimal code to compute vertical stresses in horizontal soil profile.",
    "version": "0.0.3",
    "project_urls": {
        "Documentation": "https://pyvstress.readthedocs.io/index.html",
        "Homepage": "https://gitlab.com/geosharma/pyvstress",
        "Repository": "https://gitlab.com/geosharma/pyvstress"
    },
    "split_keywords": [
        "soil mechanics",
        "geotechnical engineering",
        "vertical stresses",
        "soil profile"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60a83926d10ffac1130ab4153e625d6a7705c6bbf2a15658b1f6695e621fafb9",
                "md5": "b62f4361c74c5794e8da7fe25ab6c710",
                "sha256": "4b55825d438251eeb6834db9ca0d6997f57c49d2514fa624b4d8b07b2d06f566"
            },
            "downloads": -1,
            "filename": "pyvstress-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b62f4361c74c5794e8da7fe25ab6c710",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 25111,
            "upload_time": "2023-09-06T00:01:30",
            "upload_time_iso_8601": "2023-09-06T00:01:30.228983Z",
            "url": "https://files.pythonhosted.org/packages/60/a8/3926d10ffac1130ab4153e625d6a7705c6bbf2a15658b1f6695e621fafb9/pyvstress-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d76e0c21cd014b3912635f6f707668d955d44c6404de2e8cc83139ab2b2a641d",
                "md5": "dd15bc558f4cba4e48503d8fcb846ca2",
                "sha256": "327c555fdcb337bf8f762ca1cecf5a60c777de38b02b723e59a939bce8d5bc86"
            },
            "downloads": -1,
            "filename": "pyvstress-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "dd15bc558f4cba4e48503d8fcb846ca2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 25669,
            "upload_time": "2023-09-06T00:01:32",
            "upload_time_iso_8601": "2023-09-06T00:01:32.662494Z",
            "url": "https://files.pythonhosted.org/packages/d7/6e/0c21cd014b3912635f6f707668d955d44c6404de2e8cc83139ab2b2a641d/pyvstress-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-06 00:01:32",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "geosharma",
    "gitlab_project": "pyvstress",
    "lcname": "pyvstress"
}
        
Elapsed time: 0.12249s