A minimal code to compute vertical stresses in horizontal soil profile.
Project description
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
References:
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
- Make a
.venv
directory in the project folder. - Make a virtual environment
python -m venv .venv
- Activate the virtual environment
source .venv/bin/activate
- Install the requirements
python -m pip install -r requirements.txt
- 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
-
Place a
pyproject.toml
in the root directory of the project. Check the file for this package in the project root directory. -
Install
setuptools
andbuild
usingpip
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.
- Install
sphinx
andsphinx-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
-
Create
docs
directory in your package directory to hold the documentation files.mkdir docs
-
Run
sphinx-quickstart
in thedocs
folder. Provide the information and when asked about creating a separate folder for build typey
.
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
- Run the Sphinx API documentation command
sphinx-apidoc
to generate Sphinx source files.
[user@host docs]$ sphinx-apidoc -o source/ ../pyvstress
-
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']
- a. Change the
-
Run
make htlm
, which builds thehtlm
files in thebuild/
directory. -
Log into
ReadTheDocs
and click onImport Project
. Fill out the fields. For the repository URL usehttps://gitlab.com/geosharma/pyvstress.git
. This can be got fromCLONE -> Clone with HTPPS
URL. -
Then in
Projects -> Admin -> Integration
, click onAdd Integration
and chooseGitLab incoming webhook
. -
Then copy the URL starting with
readthedocs.org/api/v2/webhook/...../......
and paste it into GitLab ProjectSettings -> Webhooks
References:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyvstress-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc176c3f2deb6c123482ffa648826917bf6e771d0f1dd9335f13fa143ff15c9c |
|
MD5 | fdff0d6cd4a6cb6df758d65a9a74284f |
|
BLAKE2b-256 | 7ab4ed33212fbc5c4c8ae13291313aca9e9415ec0ddd744be1591d4cfa192131 |