Skip to content

Commit

Permalink
Merge pull request #55 from kaiyu-zheng/dev-latest
Browse files Browse the repository at this point in the history
version 1.3.5
  • Loading branch information
kzheng-bdai authored Mar 12, 2024
2 parents 719a957 + a6ed82d commit 498c2a9
Show file tree
Hide file tree
Showing 23 changed files with 551 additions and 134 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: pomdp-py build dev-latest wheel

on:
push:
tags:
- 'vdev-latest' # trigger on the tag vdev-latest

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:

- name: Set release name with date
id: set_release_name
run: echo "RELEASE_NAME=pomdp-py (dev-latest $(date +'%Y-%m-%d'))" >> $GITHUB_ENV

- uses: actions/checkout@v4
with:
ref: 'dev-latest'

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run release script
working-directory: .
run: |
cd scripts
./pomdp_py_release.sh
- name: Release artifact
uses: softprops/action-gh-release@v1
with:
name: ${{ env.RELEASE_NAME }}
files: dist/*.whl
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: pomdp-py repo macOS build

on:
push:
branches: [ main ]
branches: [ main, dev-latest ]
pull_request:
branches: [ main ]
branches: [ main, dev-latest ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches:
- main

- dev-latest
jobs:
pre-commit:
runs-on: ubuntu-latest
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/pypi_deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: pomdp-py package pypi deployment

on:
push:
tags:
- 'v*'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pypi-publish:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
environment:
name: testpypi
url: https://test.pypi.org/p/pomdp-py/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- name: Set Variables
if: startsWith(github.ref, 'refs/tags/v')
run: | # Run the command within a multiline string
echo "VERSION=\"Version ${{ github.ref_name }}\"" >> $GITHUB_ENV
echo "TRIGGER_FOR_TEST_PYPI=${{ github.ref == 'refs/tags/vdev-latest' }}" >> $GITHUB_ENV
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: actions/checkout@v4
with:
ref: 'dev-latest'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Run release script
working-directory: .
run: |
cd scripts
./pomdp_py_release.sh ${{ vars.RELEASE_ATTEMPT_COUNT }}
- name: Upload to Test PyPi
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ env.TRIGGER_FOR_TEST_PYPI }}
with:
# This will upload stuff under dist/ to PyPI
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip-existing: true

- name: Upload to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ ! env.TRIGGER_FOR_TEST_PYPI }}
with:
# This will upload stuff under dist/ to PyPI
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip-existing: true

- name: Release artifact
uses: softprops/action-gh-release@v1
with:
name: ${{ env.VERSION }}
files: dist/*.whl
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: pomdp-py package

on:
push:
branches: [ "main" ]
branches: [ "main", "dev-latest" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev-latest" ]

jobs:
build:
Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: pomdp-py repo ubuntu build

on:
push:
branches: [ main ]
branches: [ main, dev-latest ]
pull_request:
branches: [ main ]
branches: [ main, dev-latest ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ Changelog

Best viewed on `the website <https://h2r.github.io/pomdp-py/html/changelog.html>`_.

Version 1.3.5 (03/12/2024)
--------------------------
* Refactored :code:`_search` in :py:mod:`~pomdp_py.algorithms.po_uct.POUCT` to be more modular
* More fields made accessible for :py:mod:`~pomdp_py.algorithms.po_uct.POUCT`
* Allows initializing :py:mod:`~pomdp_py.framework.basics.Agent` and :py:mod:`~pomdp_py.framework.basics.Environment` without all models ready, and provide those models later (or update them) by :code:`set_models`
* Minor function renaming for :py:mod:`~pomdp_py.framework.basics.Option`
* Added :py:mod:`~pomdp_py.framework.oopomdp.DictState`
* Improved modularity and documentation for the RockSample example
* :py:mod:`~pomdp_py.representations.distribution.particles.WeightedParticles` now hashable if frozen.
* Changed :code:`det_dict_hash` to not use sorting
* Added a GHA workflow for automatically building, releasing wheels and uploading them to PyPI
* Repo convention: default branch renamed from :code:`master` to :code:`main`, and :code:`dev-latest` is the development branch.


WeightedParticles now hashable if frozen
Refactor _search in POUCT for more modularity
added a workflow that builds wheel
*

Modernize repo without introducing new features.
* Migrate to :code:`pyproject.toml` to specify dependencies, with minimal :code:`setup.py` to build Cython extensions.
* Separate core and optional dependencies. Optional dependencies are needed only for `pomdp_py.problems`.
* Added CI testing to repo.
* Added pre-commit checks to repo.


Version 1.3.4 (01/26/2024)
--------------------------
* Modernize repo without introducing new features.
Expand Down
33 changes: 17 additions & 16 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
include ./pomdp_py/utils/cython_utils.pxd
include ./pomdp_py/algorithms/po_uct.pxd
include ./pomdp_py/algorithms/po_rollout.pxd
include ./pomdp_py/algorithms/pomcp.pxd
include ./pomdp_py/algorithms/value_iteration.pxd
include ./pomdp_py/representations/belief/particles.pxd
include ./pomdp_py/representations/distribution/particles.pxd
include ./pomdp_py/representations/distribution/gaussian.pxd
include ./pomdp_py/representations/distribution/histogram.pxd
include ./pomdp_py/representations/distribution/gaussian.pxd
include ./pomdp_py/representations/belief/particles.pxd
include ./pomdp_py/utils/cython_utils.pxd
include ./pomdp_py/framework/oopomdp.pxd
include ./pomdp_py/framework/planner.pxd
include ./pomdp_py/framework/basics.pxd
include ./pomdp_py/framework/oopomdp.pxd
include ./pomdp_py/utils/cython_utils.pyx
include ./pomdp_py/algorithms/po_rollout.pxd
include ./pomdp_py/algorithms/pomcp.pxd
include ./pomdp_py/algorithms/po_uct.pxd
include ./pomdp_py/algorithms/value_iteration.pxd
include ./pomdp_py/problems/rocksample/cythonize/rocksample_problem.pyx
include ./pomdp_py/problems/tiger/cythonize/tiger_problem.pyx
include ./pomdp_py/algorithms/value_iteration.pyx
include ./pomdp_py/algorithms/pomcp.pyx
include ./pomdp_py/algorithms/po_rollout.pyx
include ./pomdp_py/algorithms/po_uct.pyx
include ./pomdp_py/representations/belief/particles.pyx
include ./pomdp_py/representations/distribution/particles.pyx
include ./pomdp_py/representations/distribution/histogram.pyx
include ./pomdp_py/representations/distribution/gaussian.pyx
include ./pomdp_py/framework/basics.pyx
include ./pomdp_py/representations/distribution/particles.pyx
include ./pomdp_py/representations/belief/particles.pyx
include ./pomdp_py/utils/cython_utils.pyx
include ./pomdp_py/framework/planner.pyx
include ./pomdp_py/framework/basics.pyx
include ./pomdp_py/framework/oopomdp.pyx
include ./pomdp_py/algorithms/po_rollout.pyx
include ./pomdp_py/algorithms/value_iteration.pyx
include ./pomdp_py/algorithms/pomcp.pyx
include ./pomdp_py/algorithms/po_uct.pyx
include ./thirdparty/pomdp-solve/src/pomdp-solve
6 changes: 6 additions & 0 deletions pomdp_py/algorithms/po_uct.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ cdef class POUCT(Planner):
cdef int _pbar_update_interval

cpdef _search(self)
cdef _initialize_progress_bar(self)
cpdef _perform_simulation(self, state)
cdef bint _should_stop(self, int sims_count, double start_time)
cdef _update_progress(self, pbar, int sims_count, double start_time)
cdef _finalize_progress_bar(self, pbar)

cpdef _simulate(POUCT self,
State state, tuple history, VNode root, QNode parent,
Observation observation, int depth)
Expand Down
Loading

0 comments on commit 498c2a9

Please sign in to comment.