diff --git a/Makefile b/Makefile deleted file mode 100644 index ba260dc..0000000 --- a/Makefile +++ /dev/null @@ -1,225 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source - -.PHONY: help -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " epub3 to make an epub3" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - @echo " dummy to check syntax errors of document sources" - -.PHONY: clean -clean: - rm -rf $(BUILDDIR)/* - -.PHONY: html -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -.PHONY: dirhtml -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -.PHONY: singlehtml -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -.PHONY: pickle -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -.PHONY: json -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -.PHONY: htmlhelp -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -.PHONY: qthelp -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IPETInteractivePerformanceEvaluationTools.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IPETInteractivePerformanceEvaluationTools.qhc" - -.PHONY: applehelp -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -.PHONY: devhelp -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/IPETInteractivePerformanceEvaluationTools" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/IPETInteractivePerformanceEvaluationTools" - @echo "# devhelp" - -.PHONY: epub -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -.PHONY: epub3 -epub3: - $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 - @echo - @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." - -.PHONY: latex -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -.PHONY: latexpdf -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: latexpdfja -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: text -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -.PHONY: man -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -.PHONY: texinfo -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -.PHONY: info -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -.PHONY: gettext -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -.PHONY: changes -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -.PHONY: doctest -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -.PHONY: coverage -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -.PHONY: xml -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -.PHONY: pseudoxml -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." - -.PHONY: dummy -dummy: - $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy - @echo - @echo "Build finished. Dummy builder generates no files." diff --git a/README.md b/README.md index d88badc..eedb7bb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# IPET (Interactive Performance Evaluation Tools) +IPET (Interactive Performance Evaluation Tools) +=============================================== IPET is a toolbox that allows to easily create customized benchmark tables from raw solver log files, written in Python 3. @@ -83,12 +84,12 @@ to use a differently named virtual environment somewhere else, of course. cd ipet virtualenv --python python3 venv source venv/bin/activate - + Note that you may deactivate the virtual environment at any time by calling deactivate -2. (*optional* step to install the graphical user interface, for command line only skip to next step) +2. (*optional* step to install the graphical user interface, for command line only skip to next step) Install PyQt4 bindings inside your virtual environment by calling the provided script, which assumes that you are running inside the virtual environment "venv" or the one specified by the optional path. The script will ask you to carefully read and accept the license agreement for using PyQt4 bindings. @@ -102,7 +103,7 @@ The script will ask you to carefully read and accept the license agreement for u 4. As a developer, it might be useful to call the following command instead: pip install -e . - + This creates symlinks to the IPET source files in the site-packages of the virtual environment library, and allows for more rapid testing and development. @@ -132,15 +133,15 @@ use the graphical user interface. Run the command python -m unittest test - + if the output says OK, all tests were passed. # Usage and concept **under construction** -## Overview - +## Overview + IPET takes a logfile and some optional additional files like an error-, set- and metafile, extracts information and aggregates this data in a compact table. The Logfiles need to have an `.out` extension, errorfiles need to have `.err`, setfiles are `.set` and metafiles are `.meta` @@ -154,8 +155,8 @@ It is possible to configure ipet for your own solver and testset, please check t ## Basic usage on the command line -IPET is easily used on the command line. Assume you have a logfile `testrun.out` that contains the output of running the solver on a list of instances. -The output of each run is preceded by a line indicating the instance and preceded by a line indicating correct shutdown of the solver. +IPET is easily used on the command line. Assume you have a logfile `testrun.out` that contains the output of running the solver on a list of instances. +The output of each run is preceded by a line indicating the instance and preceded by a line indicating correct shutdown of the solver. In other words your format is the following: @01 /path/to/my/first_instance.clp @@ -169,12 +170,12 @@ In other words your format is the following: @01 /path/to/my/last_instance.clp =ready= - + Now you call the parsing command with the logfile, which will create a `testrun.trn` file storing the parsed data. ipet-parse -l testrun.out - -In the second step you call the evaluation command with this `testrun.trn` file and an evaluation file that encodes the datakey and aggregation functions for your table. + +In the second step you call the evaluation command with this `testrun.trn` file and an evaluation file that encodes the datakey and aggregation functions for your table. There is an example in `scripts/evaluation.xml`. Calling `ipet-evaluate` will display the aggregated table only: @@ -184,6 +185,14 @@ If you are interesting in the considered values that result in this table you ca ipet-evaluate -e scripts/evaluation.xml -t testrun.trn --long +If you want to see what the parsed fields are, you can use + + cat logfile.out | ipet-parse -a | sort + +Then of course if you search for a specific string, you can use + + cat locafile.out | ipet-parse -a | grep Time + ## Tutorial for parsing results obtained with SCIP Say that you used SCIP to solve a number of instances and would like to get the solving time, number of nodes used and the status of the solver for each instance. This short tutorial will show you how to do that with ipet. As an input, it is assumed that you have the output of scip in a separate file for each instance in the folder `SCIP_OUT_FILES`. @@ -198,6 +207,7 @@ Concatenated logs from folder '../SCIP_OUT_FILES' into '../SCIP_OUT_FILES/concat ### Step 2 We can now parse the results by calling the ipet-parse command with the concatenated logfile: + ``` $ ipet-parse -l SCIP_OUT_FILES/concatenated.out 2021-07-01 14:49:50,530 - INFO - root - Start parsing process using 8 threads @@ -219,7 +229,7 @@ $ ipet-evaluate -t SCIP_OUT_FILES/concatenated.trn -e scripts/evaluation.xml --l 2021-07-01 14:52:33,213 - WARNING - ipet.evaluation.IPETEvalTable - Filtergroup diff-timeouts is empty and has been deactived. Instancewise Results: Time Nodes Status -ProblemName +ProblemName 31966239 36004.22 1 fail_inconsistent 31966240 36007.75 1 fail_inconsistent 31966241 36012.76 1 fail_inconsistent @@ -283,7 +293,7 @@ ProblemName 31966299 2.54 1 ok Aggregated Results: _time_ _limit_ _primfail_ _dualfail_ _fail_ _abort_ _solved_ _unkn_ _count_ _miss_ Time_shmean(1.0) Nodes_shmean(100.0) -Group +Group all 0 0 0 0 59 0 2 0 61 0 26604.848145 1.0 alloptimal 0 0 0 0 0 0 2 0 2 0 2.534996 1.0 easyinstances 0 0 0 0 0 0 2 0 2 0 2.534996 1.0 @@ -303,7 +313,7 @@ Additionally you need to place a `__init__.py` file in the `~/.ipet/solvers/` fo - `~/.ipet/readers`, where the user can define their own rules for extracting data by giving a line, position and format of the number or string they want to parse from the logfile(s). For an example check `scripts/readers-example.xml`. - `~/.ipet/solufiles`, that contains solution files with information about the correct solution of instance files or their (inf)feasibility status. For an example check `test/data/short.solu` -- +- ## Starting the graphical user interface IPET has a subdirectory called "scripts" with scripts to invoke log file parsing, test run evaluating, and starting @@ -313,7 +323,7 @@ the graphical user interface. In your virtual environment type: - pip install sphinx + pip install sphinx myst-parser cd doc make html diff --git a/doc/Makefile b/doc/Makefile index 8dc61a0..bc0d173 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -18,5 +18,6 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @mkdir -p source/commandline - @ipet-parse --docmode | tee source/commandline/ipet-parse.rst - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @ipet-parse --docmode > source/commandline/ipet-parse.rst + @ipet-parse --docmode > source/commandline/ipet-evaluate.rst + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/source/README.md b/doc/source/README.md new file mode 120000 index 0000000..fe84005 --- /dev/null +++ b/doc/source/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/doc/source/_static/.gitignore b/doc/source/_static/.gitignore new file mode 100644 index 0000000..b4cbd57 --- /dev/null +++ b/doc/source/_static/.gitignore @@ -0,0 +1,3 @@ +*png +*css +*js diff --git a/doc/source/_static/logo.png b/doc/source/_static/logo.png new file mode 100644 index 0000000..e49e2ef Binary files /dev/null and b/doc/source/_static/logo.png differ diff --git a/doc/source/conf.py b/doc/source/conf.py index fde0397..acdd943 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -33,11 +33,12 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', + 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon' + 'sphinx.ext.napoleon', + 'myst_parser' ] # Add any paths that contain templates here, relative to this directory. @@ -62,16 +63,16 @@ # built documents. # # The short X.Y version. -version = '0.2' +version = '0.0.9' # The full version, including alpha/beta/rc tags. -release = '0.2' +release = '0.0.9' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -84,8 +85,8 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False -# A boolean that decides whether module names are prepended to all object names -# (for object types where a “module” of some kind is defined), +# A boolean that decides whether module names are prepended to all object names +# (for object types where a “module” of some kind is defined), # e.g. for py:function directives. Default is True. add_module_names = False @@ -98,7 +99,7 @@ html_logo = 'logo.png' html_favicon = 'logo.png' -# If true (and html_copy_source is true as well), links to the reST sources +# If true (and html_copy_source is true as well), links to the reST sources # will be added to the sidebar. The default is True. html_show_sourcelink = False diff --git a/doc/source/index.rst b/doc/source/index.rst index e0562b8..f159672 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -15,7 +15,7 @@ Contents .. toctree:: :maxdepth: 3 - installation.md + README.md overview.md dataflow.md example_tables.md diff --git a/doc/source/installation.md b/doc/source/installation.md deleted file mode 100644 index 47c206f..0000000 --- a/doc/source/installation.md +++ /dev/null @@ -1,33 +0,0 @@ -Installation and prerequisites ------------------------------- - -This section covers the installation of IPET. We assume that you have a working -Python 2.7 installation. On top of that, we require - - matplotlib version 1.3.1 or higher - - Tkinter with Tcl/Tk version 8.5 or higher - - pandas version 0.15.0 or higher - - for some distributions, the Pillow library as a replacement for the PIL library. - -In order to install the IPET-module and its contents to the python path and -thus make it importable from every working directory you are in, -run the command: - - python setup.py install [--user] - -This will install IPET to your Python distribution, and make -it importable from every working directory in the file system. If -you do not have administrator rights on your system, append '--user' -in order to install the package to your local Python libraries. -If you now start an interactive python interpreter from any working directory, -you can import IPET as a module into your Python scripts and use its methods. - -The user interface uses the Python Image Library (PIL) to display button images -via PNG files. In case you have an error that says PIL could not be found, install -Pillow via - - pip install Pillow [--user] - -or - - python easy_install Pillow [--user] - diff --git a/doc/source/ipet.concepts.rst b/doc/source/ipet.concepts.rst index dacad0f..4207cef 100644 --- a/doc/source/ipet.concepts.rst +++ b/doc/source/ipet.concepts.rst @@ -1,54 +1,53 @@ -ipet\.concepts package -====================== +ipet.concepts package +===================== Submodules ---------- -ipet\.concepts\.Editable module -------------------------------- +ipet.concepts.Editable module +----------------------------- .. automodule:: ipet.concepts.Editable - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.concepts\.IPETMessageStream module ----------------------------------------- +ipet.concepts.IPETMessageStream module +-------------------------------------- .. automodule:: ipet.concepts.IPETMessageStream - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.concepts\.IPETNode module -------------------------------- +ipet.concepts.IPETNode module +----------------------------- .. automodule:: ipet.concepts.IPETNode - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.concepts\.Manager module ------------------------------- +ipet.concepts.Manager module +---------------------------- .. automodule:: ipet.concepts.Manager - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.concepts\.Observer module -------------------------------- +ipet.concepts.Observer module +----------------------------- .. automodule:: ipet.concepts.Observer - :members: - :undoc-members: - :show-inheritance: - + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: ipet.concepts - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/ipet.evaluation.rst b/doc/source/ipet.evaluation.rst index 18e5d14..1cae999 100644 --- a/doc/source/ipet.evaluation.rst +++ b/doc/source/ipet.evaluation.rst @@ -1,38 +1,45 @@ -ipet\.evaluation package -======================== +ipet.evaluation package +======================= Submodules ---------- -ipet\.evaluation\.Aggregation module ------------------------------------- +ipet.evaluation.Aggregation module +---------------------------------- .. automodule:: ipet.evaluation.Aggregation - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.evaluation\.IPETEvalTable module --------------------------------------- +ipet.evaluation.IPETEvalTable module +------------------------------------ .. automodule:: ipet.evaluation.IPETEvalTable - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.evaluation\.IPETFilter module ------------------------------------ +ipet.evaluation.IPETFilter module +--------------------------------- .. automodule:: ipet.evaluation.IPETFilter - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: + +ipet.evaluation.TestSets module +------------------------------- +.. automodule:: ipet.evaluation.TestSets + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: ipet.evaluation - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/ipet.misc.rst b/doc/source/ipet.misc.rst index f0a512f..7e5aa0b 100644 --- a/doc/source/ipet.misc.rst +++ b/doc/source/ipet.misc.rst @@ -1,46 +1,45 @@ -ipet\.misc package -================== +ipet.misc package +================= Submodules ---------- -ipet\.misc\.integrals module ----------------------------- +ipet.misc.integrals module +-------------------------- .. automodule:: ipet.misc.integrals - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.misc\.loader module -------------------------- +ipet.misc.loader module +----------------------- .. automodule:: ipet.misc.loader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.misc\.misc module ------------------------ +ipet.misc.misc module +--------------------- .. automodule:: ipet.misc.misc - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.misc\.quick\_Pandas module --------------------------------- +ipet.misc.quick\_Pandas module +------------------------------ .. automodule:: ipet.misc.quick_Pandas - :members: - :undoc-members: - :show-inheritance: - + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: ipet.misc - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/ipet.parsing.rst b/doc/source/ipet.parsing.rst index e4eb45a..c32fb06 100644 --- a/doc/source/ipet.parsing.rst +++ b/doc/source/ipet.parsing.rst @@ -1,118 +1,101 @@ -ipet\.parsing package -===================== +ipet.parsing package +==================== Submodules ---------- -ipet\.parsing\.MIPCLSolver module +ipet.parsing.ReaderManager module --------------------------------- -.. automodule:: ipet.parsing.MIPCLSolver - :members: - :undoc-members: - :show-inheritance: - -ipet\.parsing\.ReaderManager module ------------------------------------ - .. automodule:: ipet.parsing.ReaderManager - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.Solver module ----------------------------- +ipet.parsing.Solver module +-------------------------- .. automodule:: ipet.parsing.Solver - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader module -------------------------------------- +ipet.parsing.StatisticReader module +----------------------------------- .. automodule:: ipet.parsing.StatisticReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_CustomHistoryReader module ----------------------------------------------------------- +ipet.parsing.StatisticReader\_CustomHistoryReader module +-------------------------------------------------------- .. automodule:: ipet.parsing.StatisticReader_CustomHistoryReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_CustomReader module ---------------------------------------------------- +ipet.parsing.StatisticReader\_CustomReader module +------------------------------------------------- .. automodule:: ipet.parsing.StatisticReader_CustomReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_DualBoundHistoryReader module -------------------------------------------------------------- +ipet.parsing.StatisticReader\_DualBoundHistoryReader module +----------------------------------------------------------- .. automodule:: ipet.parsing.StatisticReader_DualBoundHistoryReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_GeneralInformationReader module ---------------------------------------------------------------- +ipet.parsing.StatisticReader\_GeneralInformationReader module +------------------------------------------------------------- .. automodule:: ipet.parsing.StatisticReader_GeneralInformationReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_PluginStatisticsReader module +ipet.parsing.StatisticReader\_PrimalBoundHistoryReader module ------------------------------------------------------------- -.. automodule:: ipet.parsing.StatisticReader_PluginStatisticsReader - :members: - :undoc-members: - :show-inheritance: - -ipet\.parsing\.StatisticReader\_PrimalBoundHistoryReader module ---------------------------------------------------------------- - .. automodule:: ipet.parsing.StatisticReader_PrimalBoundHistoryReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_SoluFileReader module ------------------------------------------------------ +ipet.parsing.StatisticReader\_TableReader module +------------------------------------------------ -.. automodule:: ipet.parsing.StatisticReader_SoluFileReader - :members: - :undoc-members: - :show-inheritance: +.. automodule:: ipet.parsing.StatisticReader_TableReader + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.StatisticReader\_VariableReader module ------------------------------------------------------ +ipet.parsing.StatisticReader\_VariableReader module +--------------------------------------------------- .. automodule:: ipet.parsing.StatisticReader_VariableReader - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.parsing\.TraceFileReader module -------------------------------------- +ipet.parsing.TraceFileReader module +----------------------------------- .. automodule:: ipet.parsing.TraceFileReader - :members: - :undoc-members: - :show-inheritance: - + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: ipet.parsing - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/ipet.rst b/doc/source/ipet.rst index ece4bdf..84604da 100644 --- a/doc/source/ipet.rst +++ b/doc/source/ipet.rst @@ -5,52 +5,59 @@ Subpackages ----------- .. toctree:: - - ipet.concepts - ipet.evaluation - ipet.misc - ipet.parsing + ipet.concepts + ipet.evaluation + ipet.misc + ipet.parsing + ipet.validation Submodules ---------- -ipet\.Experiment module ------------------------ +ipet.Experiment module +---------------------- .. automodule:: ipet.Experiment - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: + +ipet.IPETError module +--------------------- -ipet\.Key module ----------------- +.. automodule:: ipet.IPETError + :members: + :undoc-members: + :show-inheritance: + +ipet.Key module +--------------- .. automodule:: ipet.Key - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.TestRun module --------------------- +ipet.TestRun module +------------------- .. automodule:: ipet.TestRun - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: -ipet\.version module --------------------- +ipet.version module +------------------- .. automodule:: ipet.version - :members: - :undoc-members: - :show-inheritance: - + :members: + :undoc-members: + :show-inheritance: Module contents --------------- .. automodule:: ipet - :members: - :undoc-members: - :show-inheritance: + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/ipet.validation.rst b/doc/source/ipet.validation.rst new file mode 100644 index 0000000..622c0c2 --- /dev/null +++ b/doc/source/ipet.validation.rst @@ -0,0 +1,21 @@ +ipet.validation package +======================= + +Submodules +---------- + +ipet.validation.Validation module +--------------------------------- + +.. automodule:: ipet.validation.Validation + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: ipet.validation + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/scripts.rst b/doc/source/scripts.rst index ae99f56..a735f1f 100644 --- a/doc/source/scripts.rst +++ b/doc/source/scripts.rst @@ -2,6 +2,5 @@ Scripts ======= .. toctree:: - commandline/ipet-parse.rst - commandline/ipet-evaluate.rst - commandline/ipet-gui.rst + commandline/ipet-parse.md + commandline/ipet-evaluate.md diff --git a/ipet/Experiment.py b/ipet/Experiment.py index ff18841..1f71681 100644 --- a/ipet/Experiment.py +++ b/ipet/Experiment.py @@ -286,10 +286,9 @@ def calculateIntegrals(self,scale=False, lim=(None,None)): logger.error("Error for dual bound on problem %s, list: %s " % (problemid, processplotdata)) - - def printToConsole(self, formatstr = "{idx} {d}"): + def printToConsole(self, formatstr = "{idx} {d}", all_rows = False): for tr in self.testruns: - tr.printToConsole(formatstr) + tr.printToConsole(formatstr, all_rows) def saveToFile(self, filename): """ Save the experiment instance to a file specified by 'filename'. diff --git a/ipet/TestRun.py b/ipet/TestRun.py index 265a159..0937f7a 100644 --- a/ipet/TestRun.py +++ b/ipet/TestRun.py @@ -12,6 +12,7 @@ from ipet import Key from ipet import misc from pandas import DataFrame, notnull +import pandas as pd import os, sys import logging from ipet.Key import CONTEXT_LOGFILE, CONTEXT_METAFILE @@ -379,13 +380,11 @@ def emptyCurrentProblemData(self): """ return self.currentproblemdata == {} - def printToConsole(self, formatstr = "{idx}: {d}"): + def printToConsole(self, formatstr = "{idx}: {d}", all_rows = False): """ Print data to console """ for idx, d in self.data.iterrows(): -# pd.set_option('display.max_rows', len(d)) print(formatstr.format(d = d, idx = idx)) -# pd.reset_option('display.max_rows') def toJson(self): """ Return the data-object in json diff --git a/ipet/evaluation/IPETEvalTable.py b/ipet/evaluation/IPETEvalTable.py index 5e8c773..35c75b0 100644 --- a/ipet/evaluation/IPETEvalTable.py +++ b/ipet/evaluation/IPETEvalTable.py @@ -896,7 +896,8 @@ def getIndex(self) -> list: def getDefaultgroup(self, data): """Return tuple representation of defaultgroup - Parameters: + Parameters + ---------- data data frame object with columns that match the specified column index """ @@ -1635,12 +1636,10 @@ def tryGenerateIndexAndDefaultgroup(self, data): ''' Generate a reasonable index and defaultgroup based on the given data - Take a look at the columns: Key.ProblemName, Key.Solver, Key.Settings, - Key.Version and Key.LogFileName. - Set indexsplit to 1 and choose the column with the most values as rowindex. - From the remaining columns choose as columnindex as one or two columns with - as little values as possible but at least two. - At last generate a defaultgroup based on the new index. + Take a look at the columns: Key.ProblemName, Key.Solver, Key.Settings, Key.Version and + Key.LogFileName. Set indexsplit to 1 and choose the column with the most values as rowindex. + From the remaining columns choose as columnindex as one or two columns with as little values + as possible but at least two. At last generate a defaultgroup based on the new index. Parameters ---------- diff --git a/ipet/evaluation/IPETFilter.py b/ipet/evaluation/IPETFilter.py index 8c4792a..af1b6b3 100644 --- a/ipet/evaluation/IPETFilter.py +++ b/ipet/evaluation/IPETFilter.py @@ -321,12 +321,10 @@ def applyListOperator(self, df, groupindex): In combination with the 'anytestrun' attribute, there are four possibilities in total: - | anytestrun | operator | result | - |------------|----------|--------| - | one |diff |True, if there are at least 2 different values in a group | - | all |diff |True, if all values are different in this group | - | one |equal |True, if at least one value occurs twice in a group | - | all |equal |True, if there is only a single value for this group | + - anytestrun=one, operator=diff yields True, if there are at least 2 different values in a group + - anytestrun=all, operator=diff yields True, if all values are different in this group + - anytestrun=one, operator=equal yields True, if at least one value occurs twice in a group + - anytestrun=all, operator=equal yields True, if there is only a single value for this group """ # @@ -413,9 +411,10 @@ def applyFilter(self, df, groupindex = None): (only needed for list operators 'equal' and 'diff') - Returns - ------- - booleanseries : + Returns + ------- + fcol : DataFrame + filtered data frame object """ if self.operator in self.listoperators: filtercol = self.applyListOperator(df, groupindex) diff --git a/ipet/parsing/StatisticReader.py b/ipet/parsing/StatisticReader.py index 51af40e..3aff87b 100644 --- a/ipet/parsing/StatisticReader.py +++ b/ipet/parsing/StatisticReader.py @@ -20,8 +20,7 @@ class StatisticReader(IpetNode): """ - base class for all statistic readers - readers should always inherit from this base class for minimal implementation - effort + base class for all statistic readers - readers should always inherit from this base class for minimal implementation effort readers only need to overwrite the methods extractStatistic() and perhaps execEndOfProb() """ diff --git a/ipet/parsing/StatisticReader_TableReader.py b/ipet/parsing/StatisticReader_TableReader.py index afb800f..ae1535c 100644 --- a/ipet/parsing/StatisticReader_TableReader.py +++ b/ipet/parsing/StatisticReader_TableReader.py @@ -33,7 +33,7 @@ class TableReader(StatisticReader): and will store the corresponding values under Foo_a, and Foo_b """ name = 'TableReader' - tableids = ['Presolvers', 'Constraints', 'Constraint Timings', 'Propagators', 'Propagator Timings', 'Conflict Analysis', + tableids = ['Presolvers', 'Constraints', 'Constraint Timings', 'Propagators', 'Propagator Timings', 'Conflict Analysis', 'Cutselectors', 'Separators', 'Branching Rules', 'Diving Statistics', 'Diving (single)', 'Diving (adaptive)', 'LP', 'Branching Analysis', 'Primal Heuristics', 'Concurrent Solvers', 'Integrals'] columnids = ['Root Node', 'Total Time', 'B&B Tree'] active = False diff --git a/requirements-doc.txt b/requirements-doc.txt new file mode 100644 index 0000000..361b99b --- /dev/null +++ b/requirements-doc.txt @@ -0,0 +1,2 @@ +myst-parser +Sphinx diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 1e4072e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -numpy==1.17.5 -pandas==0.25.3 -pypandoc==1.4 -scipy==1.3.3 -toposort==1.5 -tqdm==4.56.0 diff --git a/requirements.txt b/requirements.txt new file mode 120000 index 0000000..9e8ec4d --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +requirements_3.10.txt \ No newline at end of file diff --git a/requirements_3.10.txt b/requirements_3.10.txt new file mode 100644 index 0000000..58d4be5 --- /dev/null +++ b/requirements_3.10.txt @@ -0,0 +1,6 @@ +numpy==1.23.5 +pandas==1.5.1 +pypandoc==1.10 +scipy==1.9.3 +toposort==1.7 +tqdm==4.64.1 diff --git a/scripts/ipet-evaluate b/scripts/ipet-evaluate index 9393475..cec7e68 100644 --- a/scripts/ipet-evaluate +++ b/scripts/ipet-evaluate @@ -19,6 +19,7 @@ from ipet.evaluation import IPETEvaluation import re import textwrap +import pypandoc import os import logging @@ -54,8 +55,13 @@ epilog = \ Key Search ---------- + By calling `ipet-evaluate` on a trn-file with the `-k ` you can search for Keys matching the given regular expression + Example + + >>> ipet-evaluate -t mytestrun.trn -k Time + will show you all keys parsed in mytestrun that contain the string "Time". ''' @@ -137,7 +143,7 @@ argparser.add_argument('-f', '--fileextensions', default = None, action = "appen argparser.add_argument('--tolerance', default = None, help = "relative objective tolerance for validation") argparser.add_argument('--colselection', default = None, help = "List of column indices to display in aggregated tables") argparser.add_argument('--horizontal', action = "store_true", default = False, help = "Should the inner index of the aggregated table be pivoted into the columns?") - +argparser.add_argument("--docmode", action = "store_true", default = False, help = "print this help as restructured text") if __name__ == '__main__': try: @@ -153,6 +159,13 @@ if __name__ == '__main__': ch = logging.StreamHandler(sys.stdout) ch.setFormatter(formatter) logger.addHandler(ch) + + if arguments.docmode: + print(pypandoc.convert_text(epilog, "rst", "md")) + print(pypandoc.convert_text(validation_doc, "rst", "md")) + print(pypandoc.convert_text(output_doc, "rst", "md")) + exit() + if arguments.quiet: logger.setLevel(logging.ERROR) elif arguments.debug: diff --git a/scripts/ipet-parse b/scripts/ipet-parse index dad22c7..775937c 100644 --- a/scripts/ipet-parse +++ b/scripts/ipet-parse @@ -84,8 +84,9 @@ argparser.add_argument('-l', '--logfiles', nargs = '*', help = "list of outfiles argparser.add_argument('-r', '--readers', nargs = '*', default = [], help = "list of additional readers in xml format that should be used for parsing") argparser.add_argument('-s', '--solufiles', nargs = '*', default = [], help = "list of solu files that should be taken into account") argparser.add_argument("-D", "--debug", action = "store_true", default = False, help = "Enable debug output to console during parsing") +argparser.add_argument("-a", "--all_rows", action = "store_true", default = False, help = "In piped moded: display all rows.") argparser.add_argument("-f", "--formatstr", default = DEFAULT_FORMATSTR, - help = """format string for displaying output per instance to console. The internal formatter uses 'idx' + help = """In piped mode: format string for displaying output per instance to console. The internal formatter uses 'idx' to reference the index and 'd' for the collected data for this instance. default : "%s" """ % DEFAULT_FORMATSTR ) argparser.add_argument("-v", "--validatedual", action = "store_true", default = Experiment.DEFAULT_VALIDATEDUAL, help = "Enable dual validation, relative to 'gaptol' parameter") @@ -164,6 +165,7 @@ if __name__ == '__main__': if arguments.docmode: print(pypandoc.convert_text(formatstrExamples, "rst", "md")) + print(pypandoc.convert_text(explainAutoloading, "rst", "md")) exit() if arguments.debug: @@ -204,4 +206,4 @@ if __name__ == '__main__': else: experiment.addStdinput() experiment.collectData() - experiment.printToConsole(arguments.formatstr) + experiment.printToConsole(arguments.formatstr, arguments.all_rows) diff --git a/setup.py b/setup.py index dbc6086..b30fae9 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ try: import pypandoc - long_description = pypandoc.convert('README.md', 'rst') + long_description = pypandoc.convert_file('README.md', 'rst') except(IOError, ImportError): long_description = "Interactive Performance Evaluation tools, see README.md"