Skip to content

Commit b9a40ca

Browse files
authored
Documentation updates (#84)
* Update type hints page * Rename sections and rewrite front page
1 parent 395f2fc commit b9a40ca

File tree

6 files changed

+75
-24
lines changed

6 files changed

+75
-24
lines changed

docs/source/advanced.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Advanced Patterns
2-
=================
1+
Adding Specialized Constraints
2+
==============================
33

44
``gurobipy-pandas`` helper methods currently only cover building linear and quadratic constraints, i.e. those which can be expressed using pandas' built-in arithmetic, groupby, and aggregation methods. In some cases you may need to build other constraint types, such as SOS or general constraints, between different series of variables. This page provides some simple recipes for such operations.
55

docs/source/index.rst

+57-12
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,85 @@
1-
Welcome to gurobipy-pandas's documentation!
2-
===========================================
1+
gurobipy-pandas documentation
2+
=============================
33

4-
``gurobipy-pandas`` is a convenient (optional) wrapper to connect pandas with gurobipy. It enables users to more easily and efficiently build mathematical optimization models from data stored in DataFrames and Series, and to read solutions back directly as pandas objects.
4+
``gurobipy-pandas`` is a convenient (optional) wrapper to connect
5+
:pypi:`pandas` with :pypi:`gurobipy`. It enables users to more easily
6+
and efficiently build mathematical optimization models from data stored
7+
in DataFrames and Series, and to read solutions back directly as pandas
8+
objects. The package provides simple to use functions and pandas
9+
accessors to help build optimization models efficiently from data and
10+
query solutions as pandas structures.
511

6-
``gurobipy-pandas`` is aimed at experienced pandas users who are familiar with methods to transform, group, and aggregate data stored in dataframes. It expects some familiarity with optimization modelling, but does not require deep experience with gurobipy.
12+
``gurobipy-pandas`` is aimed at experienced pandas users who are
13+
familiar with methods to transform, group, and aggregate data stored in
14+
dataframes. It expects some familiarity with optimization modelling, but
15+
does not require deep experience with gurobipy.
716

8-
Getting Started
9-
---------------
17+
Installation
18+
------------
1019

11-
``gurobipy-pandas`` provides simple to use functions and pandas accessors to help build optimization models and query solutions. Read the :doc:`usage` page first for an overview of the key methods. Second, explore the :doc:`examples` which provide complete model implementations formatted as Jupyter notebooks. The later sections cover advanced techniques, and advice on writing clean and performant model building code using this library.
20+
:code:`gurobipy-pandas` can be installed directly from PyPI::
21+
22+
python -m pip install gurobipy-pandas
23+
24+
This will also install pandas and gurobipy as dependencies.
25+
26+
Please note that gurobipy is commercial software and requires a license.
27+
The package ships with an evaluation license which is only for testing
28+
and can only solve models of limited size. You will be able to run all
29+
the examples given in this documentation using this evaluation license.
30+
31+
How to use this documentation
32+
-----------------------------
33+
34+
- The :doc:`usage` page provides an overview of the key methods
35+
available for creating variables and constraints in an optimization
36+
model using pandas data as input.
37+
- The :doc:`examples` provide complete model implementations as Jupyter
38+
notebooks.
39+
- The :doc:`api` provides complete reference documentation for the
40+
library.
41+
- The remaining sections (see the contents sidebar for a full listing)
42+
cover further details and techniques, and provide advice on writing
43+
clean and performant model building code using this library.
44+
45+
Contact us
46+
----------
47+
48+
For questions related to using ``gurobipy-pandas`` please use the
49+
`Gurobi Community Forum <https://support.gurobi.com/hc/en-us/community/topics/10373864542609-GitHub-Projects>`_.
50+
51+
For reporting bugs, issues and feature requests, specific to ``gurobipy-pandas``, please
52+
`open an issue <https://github.com/Gurobi/gurobipy-pandas/issues>`_.
53+
54+
If you encounter issues with Gurobi or ``gurobipy`` please contact
55+
`Gurobi Support <https://support.gurobi.com/hc/en-us>`_.
1256

13-
Documentation
14-
-------------
1557

1658
.. toctree::
59+
:hidden:
1760
:maxdepth: 1
18-
:caption: Start
61+
:caption: Getting Started
1962

2063
installation
2164
usage
2265
examples
2366

2467
.. toctree::
68+
:hidden:
2569
:maxdepth: 1
26-
:caption: Model Building
70+
:caption: Users Guide
2771

2872
performance
2973
naming
3074
advanced
75+
typing
3176

3277
.. toctree::
78+
:hidden:
3379
:maxdepth: 1
3480
:caption: Reference
3581

3682
api
37-
typing
3883
license
3984
contact
4085
acknowledgements

docs/source/naming.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Variable & Constraint Naming
2-
============================
1+
Naming Variables & Constraints
2+
==============================
33

44
It's good practice to name variables and constraints in optimization models. One good reason is that once a model is formulated from a dataset, you can write it to LP format for checking and debugging purposes.
55

docs/source/performance.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Performance
2-
===========
1+
Improving Performance
2+
=====================
33

44
This section contains general advice for improving the performance of model building code in ``gurobipy-pandas``.
55

docs/source/typing.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
Typing
2-
======
1+
Using Type Hints
2+
================
33

4-
The ``gurobipy-pandas`` API is partially typed. There is currently no mechanism in Python's type system to allow for type checking of the DataFrame or Series accessor methods. So, it is only possible to get type checking in your IDE, or static type checking with tools like ``mypy`` if you use the free functions ``gppd.add_vars`` and ``gppd.add_constrs`` when building your model.
4+
The ``gurobipy-pandas`` API is partially typed. There is currently no
5+
mechanism in Python's type system to allow for type checking of the
6+
DataFrame or Series accessor methods. So, it is only possible to get
7+
type checking in your IDE, or static type checking with tools like
8+
``mypy`` if you use the global functions ``gppd.add_vars`` and
9+
``gppd.add_constrs`` when building your model.
510

6-
To enable type checking, you should also install ``pandas-stubs`` and ``gurobipy-stubs`` in your Python environment.
11+
To enable type checking, you will also need to install
12+
:pypi:`pandas-stubs` in your Python environment.

docs/source/usage.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Usage
2-
=====
1+
Basic Usage
2+
===========
33

44
This page gives a brief run through of methods used to build optimization models in ``gurobipy-pandas`` and extract solutions. ``gurobipy-pandas`` provides several free functions for model building, and implements pandas' `accessors <https://pandas.pydata.org/docs/ecosystem.html#accessors>`_ to facilitate building models and querying results from dataframes and series respectively.
55

0 commit comments

Comments
 (0)