Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REVERTED version 1.3.5 #55

Merged
merged 78 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
5f9f3e2
dev version
zkytony Feb 23, 2024
c8f8233
adding DictState
kzheng-bdai Feb 23, 2024
73c601f
run ci on dev-latest branch
kzheng-bdai Mar 7, 2024
a7fb3e5
DictState doesn't need objclass
kzheng-bdai Feb 23, 2024
a3c66e3
allow Agent and Environment to be created without all models
kzheng-bdai Feb 23, 2024
07628da
policy model can be optional upon init for Agent
kzheng-bdai Feb 23, 2024
439580b
add test for setting model for agent
kzheng-bdai Feb 23, 2024
779cc65
test agent env set model
kzheng-bdai Feb 23, 2024
0200f41
black
kzheng-bdai Feb 23, 2024
7364081
option function names noun to verb
kzheng-bdai Feb 26, 2024
e535916
oops word correction
kzheng-bdai Feb 26, 2024
379f3d2
hashable frozen weighted particles
kzheng-bdai Mar 4, 2024
18bf588
add the frozen property
kzheng-bdai Mar 4, 2024
0d4ed8a
remove spurious argument
kzheng-bdai Mar 4, 2024
5a2ee88
refactor pouct _search to be easier for overriding
kzheng-bdai Mar 4, 2024
ca9224c
black
kzheng-bdai Mar 4, 2024
e0f9b68
comment correction
kzheng-bdai Mar 4, 2024
0afa801
type fix. time.time returns a double
kzheng-bdai Mar 4, 2024
1e3e588
remove spurious argument for pomcp
kzheng-bdai Mar 4, 2024
538c5f9
additional attributes
kzheng-bdai Mar 4, 2024
d746382
det_dict_hash without sorting
kzheng-bdai Mar 4, 2024
c7d23c9
add frozen
kzheng-bdai Mar 4, 2024
08495a1
one more attr
kzheng-bdai Mar 4, 2024
512b192
rollout policy should default to none
kzheng-bdai Mar 4, 2024
9bab4e9
one more property
kzheng-bdai Mar 4, 2024
4897adf
pbar
kzheng-bdai Mar 5, 2024
03f2764
adding release script
kzheng-bdai Mar 5, 2024
6f66651
Update scripts/README.md - remove image
kzheng-bdai Mar 5, 2024
7cb9745
include pomdp-solve in manifest
kzheng-bdai Mar 5, 2024
928b3c0
properly deal with build version while on dev-latest
kzheng-bdai Mar 5, 2024
2342920
script doesn't need an argument
kzheng-bdai Mar 5, 2024
2ec0be6
include pomdp-solve binary when building pomdp-py
kzheng-bdai Mar 5, 2024
cd59858
version should match convention
kzheng-bdai Mar 5, 2024
828be89
regenerate manifest
kzheng-bdai Mar 5, 2024
9b6825e
do not build thirdparty binary into wheel
kzheng-bdai Mar 5, 2024
d26895a
restore setup.py
kzheng-bdai Mar 5, 2024
58b1cc6
build wheel workflow
kzheng-bdai Mar 5, 2024
190a8d6
typo fix
kzheng-bdai Mar 5, 2024
7e2b5f0
workflow fix
kzheng-bdai Mar 5, 2024
8ec2eea
release script no arg
kzheng-bdai Mar 5, 2024
ec06d97
print current branch for debugging
kzheng-bdai Mar 5, 2024
ccae367
fix typo
kzheng-bdai Mar 5, 2024
ea56e8c
non interactive and non sudo for github action friendly
kzheng-bdai Mar 5, 2024
caa7746
no sudo chown
kzheng-bdai Mar 5, 2024
755a999
testing wheel release with action-gh-release
kzheng-bdai Mar 6, 2024
87246a0
trigger for wheel build should be tag
kzheng-bdai Mar 6, 2024
22a974a
release name in workflow
kzheng-bdai Mar 6, 2024
60b975f
be real now - workflow works!
kzheng-bdai Mar 6, 2024
e9d6506
rocksample minor refactor for importability
kzheng-bdai Mar 8, 2024
0f58732
make half_efficiency_dist tunable in rocksample
kzheng-bdai Mar 11, 2024
9c88419
add py3.12 to matrix for package ci
kzheng-bdai Mar 12, 2024
fcb3071
attempt count for more robust twine pypi push
kzheng-bdai Mar 12, 2024
732af8c
pypi deployment workflow attempt
kzheng-bdai Mar 12, 2024
37da463
oops
kzheng-bdai Mar 12, 2024
20e06db
remove unneeded
kzheng-bdai Mar 12, 2024
4d8e4f5
forgot id-token
kzheng-bdai Mar 12, 2024
aa34e86
try test pypi token; skip pip install ask
kzheng-bdai Mar 12, 2024
e0615e6
verbose
kzheng-bdai Mar 12, 2024
6e99a24
dramatic test
kzheng-bdai Mar 12, 2024
3f50e9a
comment out all secrets for now
kzheng-bdai Mar 12, 2024
0fb2b73
use variable
kzheng-bdai Mar 12, 2024
613942a
vars
kzheng-bdai Mar 12, 2024
bf56d3e
revert; now we may be ready
kzheng-bdai Mar 12, 2024
4ecabce
attempt count shows up later
kzheng-bdai Mar 12, 2024
6ead971
fix attempt name
kzheng-bdai Mar 12, 2024
553323d
fix fix
kzheng-bdai Mar 12, 2024
e38a99d
one more attempt
kzheng-bdai Mar 12, 2024
d67ef1f
this should do it?
kzheng-bdai Mar 12, 2024
5f82703
oops, wrong place
kzheng-bdai Mar 12, 2024
93fa947
ok good now. only run the deployment action when tagging
kzheng-bdai Mar 12, 2024
4f9f62e
release artifact at the end
kzheng-bdai Mar 12, 2024
d9f4920
workflow syntax fix
kzheng-bdai Mar 12, 2024
465ced8
simplify
kzheng-bdai Mar 12, 2024
0d439d8
fix
kzheng-bdai Mar 12, 2024
3ea2cde
release art
kzheng-bdai Mar 12, 2024
140236e
remove unnecessary readme file
kzheng-bdai Mar 12, 2024
468c3b6
changelog rst
kzheng-bdai Mar 12, 2024
a6ed82d
black
kzheng-bdai Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading