Skip to content

Commit

Permalink
Merge branch 'airbus:master' into up-variable-encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
HamdaHmida authored Sep 23, 2024
2 parents 6073f14 + 1743340 commit 7d7db1a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 32 deletions.
46 changes: 28 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ jobs:
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
- name: Generate Matrix
id: generate-matrix
shell: python3 {0}
run: |
from os import environ
python_version_build = ["3.8", "3.9", "3.10", "3.11"]
python_version_test = ["3.8", "3.11"]
python_version_build = ["3.9", "3.10", "3.11", "3.12"]
python_version_test = ["3.9", "3.12"]
test = ["macos-12", "macos-latest", "ubuntu-latest", "windows-latest"]
build_doc = "true"
Expand All @@ -87,7 +87,7 @@ jobs:
to_bool = lambda s: True if s == "true" else False
python_filter = {
'3.11': to_bool("${{ contains(github.event.head_commit.message, '[ci: python-3.11]') }}"),
'3.8': to_bool("${{ contains(github.event.head_commit.message, '[ci: python-3.8]') }}"),
'3.12': to_bool("${{ contains(github.event.head_commit.message, '[ci: python-3.12]') }}"),
'3.9': to_bool("${{ contains(github.event.head_commit.message, '[ci: python-3.9]') }}"),
'3.10': to_bool("${{ contains(github.event.head_commit.message, '[ci: python-3.10]') }}"),
}
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: install pre-commit
run: python -m pip install pre-commit
- name: get cached pre-commit hooks
Expand Down Expand Up @@ -375,12 +375,6 @@ jobs:
# build wheel
python -m cibuildwheel --output-dir wheelhouse
# set the proper platform tag
# - with poetry build + cross-compilation for arm64, the tag could been still x64_64 (https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile)
# - we downgrade the displayed macosx version to ensure compatibility with lesser macosx than the ones used on this runner
pip install "wheel>=0.40"
wheel tags --platform-tag macosx_${MACOSX_DEPLOYMENT_TARGET_WO_DOT}_${ARCH} --remove wheelhouse/*.whl
- name: Update build cache from wheels
if: steps.cache-build-dependencies.outputs.cache-hit != 'true'
run: 7z x wheelhouse/*.whl -y
Expand Down Expand Up @@ -516,7 +510,7 @@ jobs:
env:
minizinc_config_cmdline: export PATH=$PATH:~/AppData/Local/Programs/MiniZinc
minizinc_cache_path: ~/AppData/Local/Programs/MiniZinc
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-bundled-setup-win64.exe
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled-setup-win64.exe
minizinc_downloaded_filepath: minizinc_setup.exe
minizinc_install_cmdline: cmd //c "minizinc_setup.exe /verysilent /currentuser /norestart /suppressmsgboxes /sp"

Expand Down Expand Up @@ -569,7 +563,11 @@ jobs:
pip install ray[rllib]>=2.20
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*win*.whl)
pip install ${wheelfile}[all] pytest gymnasium[classic-control] optuna
if [ "$python_version" = "3.12" ]; then
pip install ${wheelfile}[all] pytest "pygame>=2.5" optuna "cffi>=1.17"
else
pip install ${wheelfile}[all] pytest gymnasium[classic-control] optuna
fi
- name: Test with pytest
run: |
Expand Down Expand Up @@ -601,7 +599,7 @@ jobs:
env:
minizinc_config_cmdline: export PATH=$PATH:$(pwd)/bin/MiniZincIDE.app/Contents/Resources
minizinc_cache_path: $(pwd)/bin/MiniZincIDE.app
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-bundled.dmg
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled.dmg
minizinc_downloaded_filepath: bin/minizinc.dmg
minizinc_install_cmdline: sudo hdiutil attach bin/minizinc.dmg; sudo cp -R /Volumes/MiniZinc*/MiniZincIDE.app bin/.

Expand Down Expand Up @@ -663,7 +661,11 @@ jobs:
python_version=${{ matrix.python-version }}
arch=$(uname -m)
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*macos*${arch}.whl)
pip install ${wheelfile}[all] pytest gymnasium[classic-control] optuna
if [ "$python_version" = "3.12" ]; then
pip install ${wheelfile}[all] pytest "pygame>=2.5" optuna "cffi>=1.17"
else
pip install ${wheelfile}[all] pytest gymnasium[classic-control] optuna
fi
- name: Test with pytest
run: |
Expand Down Expand Up @@ -695,10 +697,10 @@ jobs:
env:
minizinc_config_cmdline: export PATH=$PATH:$(pwd)/bin/squashfs-root/usr/bin; export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/bin/squashfs-root/usr/lib
minizinc_cache_path: $(pwd)/bin/squashfs-root
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-x86_64.AppImage
minizinc_url: https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage
minizinc_downloaded_filepath: bin/minizinc.AppImage
minizinc_install_cmdline: cd bin; sudo chmod +x minizinc.AppImage; sudo ./minizinc.AppImage --appimage-extract; cd ..

minizinc_prerequisites_cmdline: sudo apt update && sudo apt install libegl1 -y

steps:
- uses: actions/checkout@v4
Expand All @@ -723,6 +725,10 @@ jobs:
- name: Create bin/
run: mkdir -p bin

- name: Minizinc prerequisites
run: |
${{ env.minizinc_prerequisites_cmdline }}
- name: get MininZinc path to cache
id: get-mzn-cache-path
run: |
Expand Down Expand Up @@ -754,7 +760,11 @@ jobs:
run: |
python_version=${{ matrix.python-version }}
wheelfile=$(ls ./wheels/scikit_decide*-cp${python_version/\./}-*manylinux*.whl)
pip install ${wheelfile}[all] pytest gymnasium[classic-control] docopt commonmark optuna
if [ "$python_version" = "3.12" ]; then
pip install ${wheelfile}[all] pytest "pygame>=2.5" "cffi>=1.17" docopt commonmark optuna
else
pip install ${wheelfile}[all] pytest gymnasium[classic-control] docopt commonmark optuna
fi
- name: Test with pytest
run: |
Expand Down
9 changes: 5 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ format-jinja = """
files = ["skdecide/__init__.py"]

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
pynng = ">=0.6.2"
pathos = ">=0.2.7"
scipy = { version = ">=1.9.2", optional = true }
Expand All @@ -60,11 +60,11 @@ matplotlib = { version = ">=3.3.4", optional = true }
joblib = { version = ">=1.0.1", optional = true }
stable-baselines3 = { version = ">=2.0.0", optional = true }
ray = { extras = ["rllib"], version = ">=2.9.0", optional = true }
discrete-optimization = {git = "https://github.com/airbus/discrete-optimization.git", branch = "master", optional = true }
discrete-optimization = { version = ">=0.3.2", optional = true }
openap = { version = ">=1.5", python = ">=3.9", optional = true }
pygeodesy = { version = ">=23.6.12", optional = true }
unified-planning = { version = ">=1.1.0", python = ">=3.10", optional = true }
up-tamer = { version = ">=1.1.2", python = ">=3.10", markers = "platform_machine == 'x86_64'", optional = true }
up-tamer = { version = ">=1.1.2", python = ">=3.10, <3.12", markers = "platform_machine == 'x86_64'", optional = true }
up-fast-downward = { version = ">=0.4.1", python = ">=3.10", optional = true }
up-enhsp = { version = ">=0.0.25", python = ">=3.10", optional = true }
up-pyperplan = { version = ">=1.1.0", python = ">=3.10", optional = true }
Expand Down
16 changes: 9 additions & 7 deletions skdecide/hub/solver/cgp/pycgp/cgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,16 @@ def mutate_per_gene(self, mutation_rate_nodes, mutation_rate_outputs):
# mutate connection
self.genome[index] = rnd.randint(
0,
min(
self.max_graph_length + self.num_inputs - 1,
(
self.num_inputs
+ (int(index / (self.max_arity + 1)) - 1)
* self.num_rows
int(
min(
self.max_graph_length + self.num_inputs - 1,
(
self.num_inputs
+ (int(index / (self.max_arity + 1)) - 1)
* self.num_rows
)
* self.recurrency_distance,
)
* self.recurrency_distance,
),
)
# self.genome[index] = rnd.randint(0, self.num_inputs + (int(index / (self.max_arity + 1)) - 1) * self.num_rows)
Expand Down

0 comments on commit 7d7db1a

Please sign in to comment.