Skip to content

Commit

Permalink
Merge branch 'main' into customized
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvan Sievers committed Apr 12, 2023
2 parents 2c7b3ff + 5a9d12d commit f0aae31
Show file tree
Hide file tree
Showing 41 changed files with 759 additions and 239 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
name: Ubuntu

# see https://github.community/t5/GitHub-Actions/How-to-trigger-an-action-on-push-or-pull-request-but-not-both/m-p/35805
# and https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012/6
on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}

# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set revision
run: |
Expand All @@ -29,13 +24,13 @@ jobs:
# Compile each Fast Downward revision only once and cache the results.
- name: Cache revisions
id: cache-revisions
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: revision-cache
key: ${{ runner.os }}-revision-cache-${{ env.GIT_DOWNWARD_REV }}
key: ${{ matrix.os }}-revision-cache-${{ env.GIT_DOWNWARD_REV }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -49,7 +44,7 @@ jobs:
python -m pip install --upgrade pip tox
- name: Check style
if: matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
tox -e docs,style
Expand All @@ -63,14 +58,18 @@ jobs:
- name: Compile FF
working-directory: ../deps
run: |
sudo apt-get -y install g++ make flex bison
wget http://fai.cs.uni-saarland.de/hoffmann/ff/FF-v2.3.tgz
tar -xzvf FF-v2.3.tgz
pushd FF-v2.3/
make -j
cp ff ../
popd
rm -r FF-v2.3/ FF-v2.3.tgz
# GCC 10 fails to compile FF 2.3, so we use a precompiled FF binary.
# sudo apt-get -y install g++ make flex bison
# wget http://fai.cs.uni-saarland.de/hoffmann/ff/FF-v2.3.tgz
# tar -xzvf FF-v2.3.tgz
# pushd FF-v2.3/
# make -j
# cp ff ../
# popd
# rm -r FF-v2.3/ FF-v2.3.tgz
wget 'https://github.com/hectorpal/fast-forward-linux-binaries/raw/main/ff.gz'
gunzip ff.gz
chmod +x ff
- name: Compile runsolver
working-directory: ../deps
Expand All @@ -83,12 +82,12 @@ jobs:
popd
rm -r runsolver-dir/
- name: Install Singularity
- name: Install Apptainer
working-directory: ../deps
run: |
wget --no-verbose http://ftp.se.debian.org/debian/pool/main/s/singularity-container/singularity-container_3.5.2+ds1-1_amd64.deb -O singularity.deb
sudo dpkg -i singularity.deb
rm singularity.deb
sudo add-apt-repository -y ppa:apptainer/ppa
sudo apt-get update
sudo apt-get install -y apptainer
- name: Compile VAL
working-directory: ../deps
Expand Down Expand Up @@ -134,7 +133,7 @@ jobs:
echo CACHE: ${DOWNWARD_REVISION_CACHE}
export DOWNWARD_REPO=${DOWNWARD_REPO}
time tox -e py,ff,singularity
time tox -e py,downward,ff,singularity
- name: Test installation with pip
run: |
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: ['--extend-ignore=E203', '--exclude=build,data,revision-cache,conf.py,.git,.tox,.venv', '--max-line-length=90']

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
17 changes: 12 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ from GitHub in editable mode:
For details on how to set everything up, please see the [GitHub actions
file](.github/workflows/ubuntu.yml).

# Setting up a pre-commit hook for style checks

python3 -m pip install pre-commit
pre-commit install

Now the most important style checks are run for the changed files before each commit.

# Fixing the code style

tox -e fix-style

# Running tests

cd lab
Expand Down Expand Up @@ -59,8 +70,4 @@ Now you can run the example Singularity experiment with `tox -e singularity`.

## Run all tests

Once you have installed all dependecies, you can run all tests by executing `tox` without any options.

# Fixing the code style

tox -e fix-style
Once you have installed all dependencies, you can run all tests by executing `tox` without any options.
4 changes: 2 additions & 2 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Install Lab
-----------

Lab requires Python 3.6+ and Linux (e.g., Ubuntu). We recommend installing
Lab requires Python 3.7+ and Linux (e.g., Ubuntu). We recommend installing
Lab in a `Python virtual environment
<https://docs.python.org/3/tutorial/venv.html>`_. This has the advantage
that there are no modifications to the system-wide configuration, and that
Expand All @@ -18,7 +18,7 @@ for different papers) without conflicts::
# If PYTHONPATH is set, unset it to obtain a clean environment.
unset PYTHONPATH

# Create and activate a Python 3 virtual environment for Lab.
# Create and activate a Python virtual environment for Lab.
python3 -m venv --prompt my-paper .venv
source .venv/bin/activate

Expand Down
2 changes: 1 addition & 1 deletion dev/make-release-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

_, VERSION, CHANGELOG, LIST = sys.argv

REGEX = fr"""
REGEX = rf"""
Changelog\n
=========\n
\n
Expand Down
4 changes: 2 additions & 2 deletions dev/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if [[ $retcode != 0 ]]; then
exit 1
fi

if [[ $(git rev-parse --abbrev-ref HEAD) != master ]]; then
echo "Must be on master for release"
if [[ $(git rev-parse --abbrev-ref HEAD) != main ]]; then
echo "Must be on main branch for release"
exit 1
fi

Expand Down
1 change: 1 addition & 0 deletions docs/autobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Automatically rebuild Sphinx documentation when files change.

DOCS="$( dirname "$0" )"
DOCS="$( realpath "$DOCS" )"
REPO="$( realpath "$DOCS/../" )"

cd "$REPO/docs"
Expand Down
2 changes: 1 addition & 1 deletion docs/downward.tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ alternative that has proven to work well in practice.
Installation
------------

Lab requires **Python 3.6+** and **Linux**. To run Fast Downward
Lab requires **Python 3.7+** and **Linux**. To run Fast Downward
experiments, you'll need a **Fast Downward** repository, planning
**benchmarks** and a plan **validator**. ::

Expand Down
46 changes: 43 additions & 3 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,56 @@
Changelog
=========

next (unreleased)
v7.3 (2023-03-03)
-----------------

Lab
^^^
* Revamp Singularity example experiment: use runsolver to limit resource usage (Silvan Sievers and Jendrik Seipp).
* Transparently handle xz-compressed properties files (Jendrik Seipp).
* Add CI tests for Python 3.11 (Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* No changes so far.
* Adapt code for Matplotlib version 3.7 (Jendrik Seipp).


v7.2 (2022-10-09)
-----------------

Lab
^^^
* Raise minimum supported Python version to 3.7 (Jendrik Seipp).
* Add support for Python 3.10 (Jendrik Seipp).
* Apply parsing functions in the order in which they were added (Jendrik Seipp).
* For contributors: document pre-commit hook in ``CONTRIBUTING.md`` file (Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* Parse peak memory in anytime search parser (Jendrik Seipp).
* Only store "planner_memory" and "planner_time" attributes for successful planner
runs (Jendrik Seipp).
* Add fully customizable example planner experiment without ``FastDownwardExperiment`` class (Jendrik Seipp).
* Show how to group domain directories in example Fast Downward experiment (Jendrik Seipp).


v7.1 (2022-06-20)
-----------------

Lab
^^^
* Revamp Singularity example experiment: use ``runsolver`` to limit resource usage
(Silvan Sievers and Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
* Fix header sizes in HTML reports (Jendrik Seipp).
* Include domains in attribute overview tables even if none of their tasks has an
attribute value for all algorithms (Jendrik Seipp).
* Compute "score_planner_time" and "score_planner_memory" attributes in planner
parser (Jendrik Seipp).
* Only consider files ending with ".pddl" and ".sas" when building suites (Jendrik Seipp).
* Explicitly left-align non-numeric cells to avoid \\multicolumn entries in Latex output
(Jendrik Seipp).


v7.0 (2021-10-24)
Expand Down
22 changes: 12 additions & 10 deletions downward/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class FastDownwardExperiment(Experiment):
#: "translator_peak_memory", "translator_time_done".
#:
#: Parsed attributes: "node", "planner_memory", "planner_time",
#: "planner_wall_clock_time".
#: "planner_wall_clock_time", "score_planner_memory", "score_planner_time".
PLANNER_PARSER = os.path.join(DOWNWARD_SCRIPTS_DIR, "planner-parser.py")

def __init__(self, path=None, environment=None, revision_cache=None):
Expand Down Expand Up @@ -176,7 +176,8 @@ def add_suite(self, benchmarks_dir, suite):
"""Add PDDL or SAS+ benchmarks to the experiment.
*benchmarks_dir* must be a path to a benchmark directory. It must
contain domain directories, which in turn hold PDDL or SAS+ files.
contain domain directories, which in turn hold PDDL or SAS+ files
(ending with ".pddl" or ".sas").
*suite* must be a list of domain or domain:task names. ::
Expand All @@ -187,14 +188,14 @@ def add_suite(self, benchmarks_dir, suite):
>>> exp.add_suite(benchmarks_dir, ["rubiks-cube:p01.sas"])
One source for benchmarks is
https://github.com/aibasel/downward-benchmarks. After cloning the
repo, you can generate suites with the ``suites.py`` script. We
recommend using the suite ``optimal_strips`` for optimal STRIPS planners
and ``satisficing`` for satisficing planners::
https://github.com/aibasel/downward-benchmarks. After cloning the repo,
you can generate suites with the ``suites.py`` script. We recommend
using the suite ``optimal_strips`` for optimal STRIPS planners and
``satisficing`` for satisficing planners::
# Create standard optimal planning suite.
$ path/to/downward-benchmarks/suites.py optimal_strips
['airport', ..., 'zenotravel']
# Create standard optimal planning suite. $
path/to/downward-benchmarks/suites.py optimal_strips ['airport',
..., 'zenotravel']
Then you can copy the generated list into your experiment script::
Expand Down Expand Up @@ -362,6 +363,7 @@ def _add_code(self):
)

def _add_runs(self):
tasks = self._get_tasks()
for algo in self._algorithms.values():
for task in self._get_tasks():
for task in tasks:
self.add_run(FastDownwardRun(self, algo, task))
2 changes: 2 additions & 0 deletions downward/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def __init__(self, **kwargs):
>>> # Use a filter function to select algorithms.
>>> def only_blind_and_lmcut(run):
... return run["algorithm"] in ["blind", "lmcut"]
...
>>> report = PlanningReport(filter=only_blind_and_lmcut)
>>> # Use "filter_algorithm" to select and *order* algorithms.
Expand All @@ -97,6 +98,7 @@ def __init__(self, **kwargs):
... times = [t for t in times if t is not None]
... map[(domain, problem)] = min(times) if times else None
... return str(map)
...
"""
# Set non-default options for some attributes.
Expand Down
Loading

0 comments on commit f0aae31

Please sign in to comment.