From a10e9d65a6713955fd2f0b6006fb731813638e57 Mon Sep 17 00:00:00 2001 From: Bovard Doerschuk-Tiberi Date: Wed, 2 Oct 2024 09:18:16 -1000 Subject: [PATCH] Remove vec noise as a direct dependency (#284) * remove vec noise as a direct dependency * add vec noise to docker image --- docker/cpu.Dockerfile | 2 +- docker/gpu.Dockerfile | 2 +- kaggle_environments/envs/lux_ai_s2/lux_ai_s2.py | 2 -- .../envs/lux_ai_s2/luxai_s2/map_generator/symnoise.py | 3 ++- setup.py | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docker/cpu.Dockerfile b/docker/cpu.Dockerfile index 025ced6f..b4c86d11 100644 --- a/docker/cpu.Dockerfile +++ b/docker/cpu.Dockerfile @@ -29,6 +29,6 @@ ADD ./setup.py ./setup.py ADD ./README.md ./README.md ADD ./MANIFEST.in ./MANIFEST.in ADD ./kaggle_environments ./kaggle_environments -RUN pip install Flask bitsandbytes accelerate && pip install . && pytest +RUN pip install Flask bitsandbytes accelerate vec-noise && pip install . && pytest CMD kaggle-environments diff --git a/docker/gpu.Dockerfile b/docker/gpu.Dockerfile index 2f478378..d1258fc3 100644 --- a/docker/gpu.Dockerfile +++ b/docker/gpu.Dockerfile @@ -29,6 +29,6 @@ ADD ./setup.py ./setup.py ADD ./README.md ./README.md ADD ./MANIFEST.in ./MANIFEST.in ADD ./kaggle_environments ./kaggle_environments -RUN pip install Flask bitsandbytes accelerate && pip install . && pytest +RUN pip install Flask bitsandbytes accelerate vec-noise && pip install . && pytest CMD kaggle-environments diff --git a/kaggle_environments/envs/lux_ai_s2/lux_ai_s2.py b/kaggle_environments/envs/lux_ai_s2/lux_ai_s2.py index 059c586f..2c5af669 100644 --- a/kaggle_environments/envs/lux_ai_s2/lux_ai_s2.py +++ b/kaggle_environments/envs/lux_ai_s2/lux_ai_s2.py @@ -14,8 +14,6 @@ syspath.append(__dir__) -import vec_noise - from luxai_s2.env import LuxAI_S2 import numpy as np diff --git a/kaggle_environments/envs/lux_ai_s2/luxai_s2/map_generator/symnoise.py b/kaggle_environments/envs/lux_ai_s2/luxai_s2/map_generator/symnoise.py index 3545bee4..d1026c0c 100644 --- a/kaggle_environments/envs/lux_ai_s2/luxai_s2/map_generator/symnoise.py +++ b/kaggle_environments/envs/lux_ai_s2/luxai_s2/map_generator/symnoise.py @@ -1,7 +1,6 @@ from collections.abc import Iterable import numpy as np -from vec_noise import snoise2 def symmetrize(x, symmetry="vertical"): @@ -91,6 +90,8 @@ def noise(self, x=None, y=None, frequency: float = 1): x = x + self.noise_shift x, y = np.meshgrid(x, y) + # importing here because vec_noise causes import issues in cloud functions + from vec_noise import snoise2 total = snoise2(x, y, octaves=self.octaves) symmetrize(total, self.symmetry) # Normalize between [0, 1] diff --git a/setup.py b/setup.py index 04e850cf..d792ff57 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,6 @@ def get_version(rel_path): "Flask >= 1.1.2", "numpy >= 1.19.5", "requests >= 2.25.1", - "vec-noise >= 1.1.4", "pettingzoo == 1.24.0", "gymnasium == 0.29.0", "stable-baselines3 == 2.1.0",