Skip to content

Commit

Permalink
Merge pull request #43 from zacharylazzara/main
Browse files Browse the repository at this point in the history
Fixed import error for Python 3.10+
  • Loading branch information
t-wolfeadam authored Nov 21, 2023
2 parents b0fe36d + 7eddc97 commit 8712337
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ venv/
ENV/
env.bak/
venv.bak/

# macOS
.DS_Store
6 changes: 3 additions & 3 deletions alpyne/client/http_client.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ def api_request(self, url: str, method: str="GET", body: Any=None) -> RequestRes
if response.getcode() >= 400: # TODO model errors should warn user and mark episode as halted
raise ModelError(response.getcode(), response.reason, response.read(), url_path)
success = True
except HTTPError as err:
raise ModelError(err.code, err.reason, err.read(), url_path)
except URLError as err:
if urlErrorCounter < maxUrlErrors:
urlErrorCounter += 1
sleep(0.1)
else:
# Can either be handled from alpyne or the underlying server
raise ModelError(err.code, err.reason, err.read(), url_path)
except HTTPError as err:
raise ModelError(err.code, err.reason, err.read(), url_path)
raise ModelError(error=err.reason, path=url_path)
except socket.timeout as err:
raise ModelError(err.errno, "timeout|model exception", "see alpyne.log", url_path)

Expand Down
5 changes: 4 additions & 1 deletion alpyne/data/spaces.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import itertools
import logging
from collections import Iterable, Mapping
try:
from collections.abc import Iterable, Mapping
except ImportError:
from collections import Iterable, Mapping
from datetime import datetime
from math import ceil
from typing import Any, Dict, List, Optional, Union, Tuple, Callable
Expand Down
Binary file removed alpyne/resources/alpyne_lib/com.anylogic.engine.jar
Binary file not shown.
Binary file removed alpyne/resources/alpyne_lib/com.anylogic.rl.data.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
python_requires='>=3',
install_requires=[
"gym",
"numpy"
"numpy"
],
)

0 comments on commit 8712337

Please sign in to comment.