Welcome to CLT Calculation for Python’s documentation!¶
CLT Calculation for Python¶
This packages provides methodes for calculating fiber-reinforced materials.
- Free software: MIT license
- Documentation: https://clt-py.readthedocs.io.
Features¶
- TODO
Credits¶
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Installation¶
Stable release¶
To install CLT Calculation for Python, run this command in your terminal:
$ pip install clt_py
This is the preferred method to install CLT Calculation for Python, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources¶
The sources for CLT Calculation for Python can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/axelschmidt91/clt_py
Or download the tarball:
$ curl -OJL https://github.com/axelschmidt91/clt_py/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Usage¶
To use CLT Calculation for Python in a project:
import clt_py
or:
from clt_py import *
or any other format you prefer.
Setting up materials¶
# Matrix material:
matMat = IsotropicMaterial(rho=1, E=1, v=0.25)
# Fiber material:
matFib = AnisotropicMaterial(rho=2, v_para_ortho=0.25, E_para=10, E_ortho=2, G=3)
# Composite Material:
mat_FRM = FiberReinforcedMaterialUD(matFib=matFib, matMat=matMat)
Set up plies/layers¶
ply0 = Ply(mat_FRM, rotation=0, thickness=1)
plyP45 = Ply(mat_FRM, rotation=45, thickness=1)
plyN45 = Ply(mat_FRM, rotation=-45, thickness=1)
Arrange plies to laminate¶
laminate = Laminate()
laminate.addPly(plyP45)
laminate.addPly(ply0)
laminate.addPly(plyN45)
clt_py¶
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/axelschmidt91/clt_py/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.
Write Documentation¶
CLT Calculation for Python could always use more documentation, whether as part of the official CLT Calculation for Python docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/axelschmidt91/clt_py/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up clt_py for local development.
Fork the clt_py repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/clt_py.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv clt_py $ cd clt_py/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 clt_py tests $ python setup.py test or pytest $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
- The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check https://travis-ci.org/axelschmidt91/clt_py/pull_requests and make sure that the tests pass for all supported Python versions.
Deploying¶
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:
$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags
Travis will then deploy to PyPI if tests pass.
Credits¶
Development Lead¶
- Axel Schmidt <schmidt.axel.91@gmail.com>
Contributors¶
None yet. Why not be the first?
History¶
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Unreleased¶
- changes:
- version number
- long_description_conent_type in setup.py
0.0.4 (2020-01-24)¶
- changed:
- requirements_dev.txt to updated packades
- requirements.txt
- fixed:
- upload to pypi with API Token
0.0.3 (2020-01-24)¶
- First release on PyPI.
- add class Material2D - base class for all materials used in this package.
- add class IsotropicMaterial - Material2D class for isotropic materials.
- add class AnisotropicMaterial - Material2D class for anisotropic materials.
- add class FiberReinforcedMaterialUD - Material2D class that combines two materials.
- add class Ply - generates defined ply/layer of Material2D.
- add class Laminate - combines mulitple Ply instances to composite laminate.
- dev setup:
- add .pre-commit-config.yaml - formating with black
- changed travis - add
black --check
on ‘before_script’ method - changed requirements_dev.txt
- add requirements.txt
- add tests for classes
- fix tox python 3.8 and flake8 checking
- add flake8 ignore: E501, W503, F841
- update mail adress
- docs:
- changed usage.rst - new Version update to use package
0.0.2 (2020-01-22)¶
- setup of package
- first ideas of structure