Welcome to lmfit-varpro’s documentation!¶
Deprecated¶
This package only serves as archive and will be deleted soon.
Installation¶
Stable release¶
To install lmfit-varpro, run this command in your terminal:
$ pip install lmfit-varpro
This is the preferred method to install lmfit-varpro, 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 lmfit-varpro can be downloaded from the Github repo.
You can simply use pip to install it directly from the Github repo.
$ pip install git+https://github.com/glotaran/lmfit-varpro.git
Or you can either clone the public repository:
$ git clone git://github.com/glotaran/lmfit-varpro
Or download the tarball:
$ curl -OL https://github.com/glotaran/lmfit-varpro/tarball/master
And once you have a copy of the source, you can install it with:
$ python setup.py install
API Documentation¶
The API Documentation for lmfit_varpro is automatically created from its docstrings.
constraints |
|
qr_decomposition |
|
result |
|
separable_model |
|
util |
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/glotaran/lmfit-varpro/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¶
lmfit-varpro could always use more documentation, whether as part of the official lmfit-varpro docs, in docstrings, or even on the web in blog posts, articles, and such. If you are writing docstrings please use the NumPyDoc style to write them.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/glotaran/lmfit-varpro/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 lmfit-varpro for local development.
Fork the lmfit-varpro repo on GitHub.
Clone your fork locally:
$git clone git@github.com:your_name_here/lmfit-varpro.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 lmfit_varpro $cd lmfit_varpro/ $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.
5. When you’re done making changes, check that your changes pass all tests (unit tests, codestyle tests and doc creation test):
$tox
To get all requirements run `pip install -r requirements_dev.txt` in 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.6 and 3.7. Check https://travis-ci.org/glotaran/lmfit_varpro/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:
$ bumpversion patch # possible: major / minor / patch
$ git push
$ git push --tags
Travis will then deploy to PyPI if tests pass.
“how to” in depth¶
This section serves as a more complete guide for new developers, as well
as place to put useful resources for fast lookup i.e. if you forgot an option for .. toctree::
.
Virtual envs “how to” in depth¶
This Section explains how to get you virtual env up an running with different virtual env providers.
Using conda¶
Note
This is the recommended way if you use Windows.
Installation¶
First you have to download anaconda (conda installation with “full” science stack) or miniconda (minimal conda installation) for your OS and follow its install instructions.
After that is done (maybe a restart of the terminal or PC is needed) have the conda
command
available in your terminal:
$conda update conda
Environment creation¶
If that is working, create an environment:
$conda create --name glotaran python=3.6 -y
Note
Python 3.7 could also be used, but packages can’t be installed with conda install packages
right now. If the packages are are on PIPY already they can still be installed with
pip install package
.
De-/Activating an Environment¶
To activate the environment run:
$source activate glotaran
Or to deactivate respectively:
$source deactivate
Note
On default Windows terminal (cmd/PS) you might need omit source
and run
activate glotaran
/deactivate
instead.
Note
To easily manage your conda environments you can use the tool enboard .
Warning
If you want to use enboard
with git bash on Windows,
this won’t work out of the box.
You will have to edit your .bash_profile
as follows:
export CONDA_ROOT_DIR='/path/to/conda/windows/style' # i.e. mine is 'C:\Anaconda3'
alias python='winpty python'
alias enboard='winpty enboard'
Using mkvirtualenv¶
The full virtualenvwrapper documentation.
Installation¶
To install virtualenvwrapper
run:
$pip install virtualenvwrapper
$source /usr/local/bin/virtualenvwrapper.sh
Note
Depending on your python installation you will have to search for the location of
virtualenvwrapper.sh
and change the path accordingly.
Warning
The line source /usr/local/bin/virtualenvwrapper.sh
is for Posix Terminals and
might not work on Windows terminals.
Environment creation¶
To create an environment with virtualenvwrapper
run:
$mkvirtualenv glotaran
You should now already be in that environment:
(glotaran)$
De-/Activating an Environment¶
To change in an existing environment from a fresh terminal run:
$workon glotaran
Or to deactivate respectively:
$deactivate
Setting up glotaran¶
Once you got your environment running you can start contributing to glotaran. Just run the following commands and you are all set:
(glotaran)$git clone https://github.com/<your_name_here>/glotaran.git
(glotaran)$cd glotaran
(glotaran)$python -m pip install -r requirements_dev.txt
(glotaran)$pip install -e .
Documentation “how to” in depth¶
Our documentation is build using Sphinx, which uses
reStructuredText
(and with extensions Markdown
) to compile documentation as html
, LaTeX
,
PDF
and more.
It takes care of linking all pages together, building a search index and also extraction the documentation
written in the docstrings of the code.
How to use Sphinx in general¶
First you have enter your virtual env (if you don’t know how, have a look here: Get Started! or Virtual envs “how to” in depth)
When you are in your virtual env (here called glotaran
) navigate to glotarans docs folder:
(glotaran)$cd docs
Note
Consider for the following steps that, if you are on a Posix system
(Linux, MacOS, BSD or Git Bash/migwin on Windows) use make
,
on normal Windows cmd/PS use make.bat
instead.
If your Git Bash is missing the make functionality you can follow this
guide.
Once you are in the docs folder, generating/compiling the documentation is as easy as running:
(glotaran)$make html
The documentation than can be found is the folder docs/_build/html
, where you can open it by
double clicking index.html
Warning
The reStructuredText
Syntax isn’t as forgiving as html
(where browsers correct most
of the falsey). It’s more like LaTeX
, which is why it is recommended to compile often,
for errors not to stack up.
It might happen, that you change the documentation and can’t see the changes after a refresh in the browser. Since Sphinx to reduce the compile time, it only recompiles the changed files, which can lead to problems if you add new files, because the indexing wasn’t updated. If this happens, you can force Sphinx to rebuild the whole documentation by first running:
(glotaran)$make clean
Workflow¶
Change the docs
Build the docs:
(glotaran)$make html
Look at the commandline interface and make sure no errors happened.
Refresh the you browser to see the changes.
If there are no changes, even so there was no error, force Sphinx to rebuild all:
(glotaran)$make clean html
Start with step 1 again.
- Useful resources:
- Often used commands (for Windows replace
`make
with`make.bat
): (glotaran)$make html
(glotaran)$make clean
(glotaran)$make clean html
(glotaran)$make help
Generate API Documentation¶
The API Documentation will be generated automatically form the docstrings. Those Docstrings should be formatted in the NumPyDoc style. Please make use of all available features as you see fit.
- The features are:
- Parameters
- Returns
- Raises
- See Also
- Notes
- References
- Examples
If you add packages
, modules
, classes
, methods
, attributes
,
functions
or exceptions
, please read the introduction of Api Documentation Creation Helper.
Often used commands (for Windows replace `make
with `make.bat
):
(glotaran)$make html
(glotaran)$make clean_all
(glotaran)$make api_docs
(glotaran)$make clean_all api_docs html
Api Documentation Creation Helper¶
The helper Module to generate the API documentation is located at docs/generate_api_documentation.py.
The functionality is available by calling make api_docs
on a Posix system
or make.bat api_docs
on Windows.
If you add packages
, modules
, classes
, methods
, attributes
,
functions
or exceptions
, you might need to run make clean_all
on a Posix system
or make.bat clean_all
on Windows to see changes in the documentation.
The generation of the API is done by traversing the main package traverse_module and listing all child modules for autosummary to process (see write_api_documentation, api_documentation.rst and _templates/api_documentation_template.rst).
If the child module is also a package all its contained modules will be listed (see write_known_packages, known_packages.rst, _templates/known_packages_template.rst and _templates/autosummary/module.rst).
To understand how it works in detail the following links might be of help:
Authors¶
Original Founder¶
Ivo van Stokkum <i.h.m.van.stokkum@vu.nl>
Development Lead¶
- Joris Snellenburg <j.snellenburg@gmail.com>
- Joern Weissenborn <joern.weissenborn@gmail.com>
Contributors¶
Sebastian Weigand <s.weigand.phy@gmail.com>
Special Thanks¶
- Stefan Schuetz <YamiNoKeshin@gmail.com>
History¶
0.0.5 (2018-08-09)¶
- bugfix
0.0.3 (2018-08-09)¶
- exposed nan_policy option
0.0.1 (2018-07-22)¶
- First release on PyPI.
Credits¶
Thanks goes to these projects/peoples work that helped us developing:
- cookiecutter (documentation skeleton)
- audreyr/cookiecutter-pypackage (documentation skeleton)