Skip to content

Commit

Permalink
Merge pull request #135 from aig-upf/devel
Browse files Browse the repository at this point in the history
Create Release 0.8
  • Loading branch information
gfrances authored Apr 7, 2022
2 parents 7d955e5 + f0ebe18 commit ba41346
Show file tree
Hide file tree
Showing 105 changed files with 7,106 additions and 414 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "CodeQL"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
43 changes: 43 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Code coverage

on:
pull_request:

env:
DOWNWARD_BENCHMARKS: "/tmp/downward-benchmarks"
FSBENCHMARKS: "/tmp/fs-benchmarks"

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
# Install all dependencies, then get some benchmarks that we'll use to run the tests.
# Curl below is necessary to download the benchmarks
run: |
sudo apt-get install -y --no-install-recommends gringo curl
python -m pip install --upgrade tox pip setuptools wheel
gringo --version
tox --version
./scripts/get-benchmarks
- name: Run tests with coverage enabled
run: tox -v -e coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
# env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
verbose: true
46 changes: 46 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

# Relevant pointers:
# - https://github.com/pypa/gh-action-pypi-publish
# - https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

on:
# We assume that releases are made from master branch, which is protected against direct pushes, and hence all code
# there will have successfully run through all unit test, etc. in the PR-configured workflows
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

# We'll first do a test upload, and only if successful do the real upload
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1.5.0
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
107 changes: 107 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Tests

on:
# The master branch is protected against direct pushes.
# Let's run the tests on all PRs and pushes
pull_request:
branches: [ master, devel ]
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
types: [opened, reopened]
push:

env:
DOWNWARD_BENCHMARKS: "/tmp/downward-benchmarks"
FSBENCHMARKS: "/tmp/fs-benchmarks"

jobs:
unit_tests:
strategy:
# Keep running all parameter combinations even if one fails
fail-fast: false

matrix:
# Currently, we only test on ubuntu, would be good to extend to macos-latest, windows-latest,
# but this requires a bit of extra work to get the dependencies installed there too
os: [ubuntu-latest]

# We run unit tests on all currently active Python releases, see https://www.python.org/downloads/.
# GH-hosted versions for the Ubuntu image are listed here:
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
# We also run tests in the latest pre-release version. Available pre-releases are listed here:
# https://github.com/actions/python-versions/releases
# Note that for the pre-release, we set the `experimental` tag, and hence the `continue-on-error` flag, to true;
# this way, failuares are treated as a warning and don’t fail the whole workflow. This is sometimes referred to
# as a "shadow CI job".
# pypy is currently disabled, as it takes a long time to run (>20mins)
# python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
experimental: [false]

# I'm temporarily disabling the build on the 3.11 alpha, as the installation aims at buiilding the scipy wheel,
# which fails spectacularly with a 10K lines log of Fortran compilation errors.
# Let's wait a bit until a binary wheel is available
# include:
# - os: ubuntu-latest
# python-version: '3.11.0-alpha.5'
# experimental: true

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}

steps:
- name: Clone repo
uses: actions/checkout@v2

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

- name: Install dependencies
# Install all dependencies, then get some benchmarks that we'll use to run the tests.
# Curl below is necessary to download the benchmarks
run: |
sudo apt-get install -y --no-install-recommends gringo curl
python -m pip install --upgrade tox pip setuptools wheel
gringo --version
tox --version
./scripts/get-benchmarks
- name: Run tests (with continue-on-error = ${{ matrix.experimental }})
run: |
tox -v -e pytest
style:
strategy:
# Keep running all parameter combinations even if one fails
fail-fast: false

# We run style tests only on the latest active Python releases, see https://www.python.org/downloads/.
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
toxenv: ['docs', 'antlrgrammars', 'pylint', 'flake8', 'mypy']

runs-on: ${{ matrix.os }}
steps:
- name: Clone repo
uses: actions/checkout@v2

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

# Gringo and pandoc required only for the documentation tox environment
# Pandoc is installed as an APT package as recommended in the installation instructions.
- name: Install Gringo
if: matrix.toxenv == 'docs'
run: sudo apt-get install -y --no-install-recommends gringo pandoc && gringo --version

- name: Install tox and packaging dependencies
run: |
python -m pip install --upgrade tox pip setuptools wheel
tox --version
- name: Run tox environment ${{ matrix.toxenv }}
run: tox -v -e ${{ matrix.toxenv }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

# ply-generated obejcts
parsetab.py

# Object code
*.slo
*.lo
Expand Down
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

53 changes: 52 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,58 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
### Fixed

## [0.7.0]

## [0.8.0] 2022-04-07
### Changed
- Added support for `clingo`'s `pypi` distribution, avoiding the need to install it manually.
Some internal interfaces were changed, review these changes if your code is coupled to the ASP-based grounding
components (#123). `clingo` now is an `extra` dependency of our package. Use `pip install tarski[clingo]`
to install tarski with it. The ASP-based grounding component will fall back to a "manually installed" `clingo`
in the `PATH` if the Python package is not present.
### Added
- Temporal planning model:
- Added concept of post-condition (i.e. `at end` conditions) `Action` class
- Added concept of duration to `Action` class
- Added concept of grounding constraints to `Action` class
- Naive grounding features:
- Added method to exhaustively ground terms with subterms that are constants. For instance, the term `foo(x, a)`
where `x` is a variable and `a` is a constant can be now grounded taking into account that the second argument of
`foo` is already fixed to `a`.
- Error reporting and handling:
- `UndefinedTerm`: added name of term as an argument. This enables processing exception data, for instance,
to initialise such terms to some value like `infty` or force the failure to ground some structural element in
a domain, such as an action.
- _Experimental_ support for a SAS writer (work in progress).
- _Experimental_ ply-based PDDL parser (work in progress):
- Current implementation using `ply` package, version 3.11. Eventually will be refactored for `sly`. Plan is
eventually to parse correctly and generate instance structural elements for PDDL 3.1.
- Supported features:
- Instantaneous actions
- Durative actions
- Care has been taken so the parser allows the keyword `at` to be used as a predicate/function/type identifier
- Derived predicates
- Object fluents
- Metrics associated with IPC formulations of temporal planning
- Partial support:
- Conditional effects
- Quantified conditions in preconditions, conditional effects and derived predicates
- Arithmetic expressions and effects
- New formula visitor: `CollectEqualityAtoms`
- What it says on the tin: collects equality atoms that appear as subformulas of a given formula
- New optional `pip` dependency: `ply`
- `FirstOrderLanguage.is_subtype`: it is now checked if there is a path connecting two types in the type hierarchy. If
that is the case, this fact is recorded in the dictionary `indirect_ancestor_sorts`. Whenever a change is made
in the type hierarchy (e.g. adding a new sort or changing the parent of a sort), the cache is invalidated.
### Removed
### Fixed
- Fixed issue with `parse_atom` method and whitespace in the description of atoms (#121)
- Fixed issue with printing of types in untyped domains (#113)
- Use real instead of integer numbers by default when parsing with strict_with_requirements=False (#114)
- Fixed issue with equality predicates trying to coerce the right hand side to a constant when the left hand side is
a term


## [0.7.0] - 2021-05-12
### Added
- Added some basic forward search capabilities (#101).
- Import psutil module conditionally, to offer better support for non-Linux
Expand Down
8 changes: 8 additions & 0 deletions HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# tarski: An AI Planning Modeling Framework
#
# Author: <name> <email address>
# ----------------------------------------------------------------------------------------------------------------------
# <path to file>
#
# <brief description of the contents of the file>
# ----------------------------------------------------------------------------------------------------------------------
Loading

0 comments on commit ba41346

Please sign in to comment.