Skip to content

Commit

Permalink
minor doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorb1 committed Aug 22, 2023
1 parent 53871a8 commit f6d9c35
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
23 changes: 12 additions & 11 deletions docs/functionality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,26 @@ so as to speed up the model matrix generation and solution times.
``otoole results``
~~~~~~~~~~~~~~~~~~

The ``results`` command creates a folder of CSV result files from a CBC_, CLP_,
The ``results`` command creates a folder of CSV result files from a GLPK_, CBC_, CLP_,
Gurobi_ or CPLEX_ solution file together with the input data::

$ otoole results --help
usage: otoole results [-h] [--write_defaults]
usage: otoole results [-h] [--glpk_model GLPK_MODEL] [--write_defaults]
{cbc,cplex,gurobi} {csv} from_path to_path {csv,datafile,excel} input_path config

positional arguments:
{cbc,cplex,glpk,gurobi} Result data format to convert from
{csv} Result data format to convert to
from_path Path to file or folder to convert from
to_path Path to file or folder to convert to
{csv,datafile,excel} Input data format
input_path Path to input_data
config Path to config YAML file
{cbc,cplex,glpk,gurobi} Result data format to convert from
{csv} Result data format to convert to
from_path Path to file or folder to convert from
to_path Path to file or folder to convert to
{csv,datafile,excel} Input data format
input_path Path to input_data
config Path to config YAML file

optional arguments:
-h, --help show this help message and exit
--write_defaults Writes default values
-h, --help show this help message and exit
--glpk_model GLPK_MODEL GLPK model file required for processing GLPK results
--write_defaults Writes default values

.. versionadded:: v1.0.0
The ``config`` positional argument is now required
Expand Down
2 changes: 1 addition & 1 deletion src/otoole/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def read_results(
input_path: str,
glpk_model: str = None,
) -> Tuple[Dict[str, pd.DataFrame], Dict[str, float]]:
"""Read OSeMOSYS results from CBC, GLPK or Gurobi results files
"""Read OSeMOSYS results from CBC, GLPK, Gurobi, or CPLEX results files
Arguments
---------
Expand Down
8 changes: 3 additions & 5 deletions src/otoole/results/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import pandas as pd

from otoole.input import ReadStrategy

# from otoole.preprocess.longify_data import check_datatypes
from otoole.results.result_package import ResultsPackage

LOGGER = logging.getLogger(__name__)
Expand All @@ -22,7 +20,7 @@ def read(
Arguments
---------
filepath : str, TextIO
A path name or file buffer pointing to the CBC solution file
A path name or file buffer pointing to the solution file
input_data : dict, default=None
dict of dataframes
Expand Down Expand Up @@ -89,13 +87,13 @@ def _convert_to_dataframe(self, file_path: Union[str, TextIO]) -> pd.DataFrame:
def _convert_wide_to_long(self, data: pd.DataFrame) -> Dict[str, pd.DataFrame]:
"""Convert from wide to long format
Converts a pandas DataFrame containing all CBC results to reformatted
Converts a pandas DataFrame containing all wide format results to reformatted
dictionary of pandas DataFrames in long format ready to write out
Arguments
---------
data : pandas.DataFrame
CBC results stored in a dataframe
results stored in a dataframe
Example
-------
Expand Down

0 comments on commit f6d9c35

Please sign in to comment.