Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Multi model api #32

Merged
merged 40 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dce93b8
Set up sphinx engine
ckoerber Oct 15, 2021
0f9b550
Started to work on GUI doc
ckoerber Oct 15, 2021
0669cd3
Added host and port options
ckoerber Oct 15, 2021
4253991
Brought doc to the front page
ckoerber Oct 15, 2021
e012142
Documented the base module
ckoerber Oct 15, 2021
32192e5
Typehints
ckoerber Oct 15, 2021
388cbce
Changed import statements
ckoerber Oct 15, 2021
b36a40e
Updated the documentation
ckoerber Oct 15, 2021
db7a133
Tiny doc updates
ckoerber Oct 18, 2021
da23e97
Added more example descriptions
ckoerber Oct 18, 2021
55f3eab
Removed un-documented rst files
ckoerber Oct 18, 2021
ef6a303
Updated example readme
ckoerber Oct 18, 2021
f345f58
Added MultiFitterModel agnostic plot api
ckoerber Oct 26, 2021
284c15a
Added function which transforms a multi-model fitter to a "regular" n…
ckoerber Oct 28, 2021
390fa78
Updated plot functions to make more sense depending on fit.x values i…
ckoerber Oct 28, 2021
8d711ae
Added a multi-model fit example and test
ckoerber Oct 28, 2021
8e933b4
Set up sphinx engine
ckoerber Oct 15, 2021
e2bb0ef
Started to work on GUI doc
ckoerber Oct 15, 2021
486f96f
Added host and port options
ckoerber Oct 15, 2021
31a4d1f
Brought doc to the front page
ckoerber Oct 15, 2021
1e1e4d7
Documented the base module
ckoerber Oct 15, 2021
c0c6d76
Typehints
ckoerber Oct 15, 2021
9455151
Changed import statements
ckoerber Oct 15, 2021
5e3dfc0
Updated the documentation
ckoerber Oct 15, 2021
47bd585
Tiny doc updates
ckoerber Oct 18, 2021
8a86d7d
Added more example descriptions
ckoerber Oct 18, 2021
1869b25
Removed un-documented rst files
ckoerber Oct 18, 2021
67d941d
Updated example readme
ckoerber Oct 18, 2021
9292154
Merge branch 'documentation' of https://github.com/ckoerber/lsqfit-gu…
ckoerber Nov 3, 2021
aa9bda6
Changed to pydata theme
ckoerber Nov 3, 2021
0ec981f
Merge branch 'v0.1.0' into documentation
ckoerber Nov 4, 2021
02bcf41
Run test on version branches
ckoerber Nov 4, 2021
ab27aa5
Create LICENSE
ckoerber Nov 4, 2021
d967b50
Create CONTRIBUTING.md
ckoerber Nov 4, 2021
e250355
Merge pull request #18 from ckoerber/documentation
ckoerber Nov 4, 2021
28e33d3
Added MultiFitterModel agnostic plot api
ckoerber Oct 26, 2021
61262fc
Added function which transforms a multi-model fitter to a "regular" n…
ckoerber Oct 28, 2021
6e20e02
Updated plot functions to make more sense depending on fit.x values i…
ckoerber Oct 28, 2021
41859e3
Added a multi-model fit example and test
ckoerber Oct 28, 2021
cd92cfc
Merge branch 'multi-model-api' of https://github.com/ckoerber/lsqfit-…
ckoerber Nov 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches:
- master
- 'v*'

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__
*.p
*.log
tmp
build
89 changes: 89 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure the new feature works as intended and existing tests are running.
2. Lint and format the files. For this project, we use [flake8](https://github.com/PyCQA/flake8) and [black](https://github.com/psf/black).
3. Update the README.md and or docs (if applicable) with details of changes to the interface.
4. Increase the version numbers in `lsqfitgui/_version.txt`. The versioning scheme we use is [SemVer](http://semver.org/).
5. You may merge the Pull Request in once you have the sign-off of at least one other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <[email protected]>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 @ckoerber and @millernb

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Graphical user interface for `lsqfit` using `dash`.

![GUI example generated by `example/entrypoint.py`](doc/static/gui-example.png)
![GUI example generated by `example/entrypoint.py`](doc/source/_static/gui-example.png)

## Install

Expand Down
26 changes: 26 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXAPIDOC ?= sphinx-apidoc
SOURCEDIR = source
BUILDDIR = ../build
MODULESDIR = ../lsqfitgui

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: autodoc
autodoc:
$(SPHINXAPIDOC) -e -o $(SOURCEDIR)/api $(MODULESDIR)
35 changes: 35 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
20 changes: 20 additions & 0 deletions doc/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Newlines (\a) and spaces (\20) before each parameter */
.sig-param::before {
content: "\a\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20";
white-space: pre;
}

/* Newline after the last parameter (so the closing bracket is on a new line) */
dt em.sig-param:last-of-type::after {
content: "\a";
white-space: pre;
}

/* To have blue background of width of the block (instead of width of content) */
dl.class > dt:first-of-type {
display: block !important;
}

dt.sig {
width: 100%;
}
File renamed without changes
25 changes: 25 additions & 0 deletions doc/source/api/lsqfitgui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
API: lsqfitgui
=================

.. currentmodule:: lsqfitgui

``run_server``
--------------

.. autofunction:: run_server

``plot_gvar``
--------------

.. autofunction:: plot_gvar

``wrap_plot_gvar``
------------------

.. autofunction:: wrap_plot_gvar


``FitGUI``
------------------

.. autoclass:: FitGUI
79 changes: 79 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))

# -- Project information -----------------------------------------------------

project = "lsqfitgui"
copyright = "2021, @ckoerber, @millernb"
author = "@ckoerber, @millernb"

# The full version, including alpha/beta/rc tags
release = "0.0.1"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"myst_parser",
]

source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}

autoclass_content = "both"
autodoc_typehints = "description"
autodoc_preserve_defaults = True
napoleon_use_admonition_for_examples = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"collapse_navigation": False,
"show_toc_level": 2,
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_css_files = [
"custom.css",
]


add_module_names = False
Loading