Skip to content
Snippets Groups Projects
Commit b0a7bdba authored by mohanty's avatar mohanty
Browse files

Merge branch 'spm/code-improvements' into 'master'

Bump version: 0.3.2 → 0.3.3

See merge request flatland/flatland!132
parents 1a37a638 71184d97
No related branches found
No related tags found
No related merge requests found
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
__author__ = """S.P. Mohanty""" __author__ = """S.P. Mohanty"""
__email__ = 'mohanty@aicrowd.com' __email__ = 'mohanty@aicrowd.com'
__version__ = '0.3.2' __version__ = '0.3.3'
import io import io
import os import os
import platform
import time import time
import tkinter as tk import tkinter as tk
...@@ -27,8 +26,6 @@ def enable_windows_cairo_support(): ...@@ -27,8 +26,6 @@ def enable_windows_cairo_support():
enable_windows_cairo_support() enable_windows_cairo_support()
from cairosvg import svg2png # noqa: E402 from cairosvg import svg2png # noqa: E402
from screeninfo import get_monitors # noqa: E402
from flatland.core.grid.rail_env_grid import RailEnvTransitions # noqa: E402 from flatland.core.grid.rail_env_grid import RailEnvTransitions # noqa: E402
...@@ -55,19 +52,13 @@ class PILGL(GraphicsLayer): ...@@ -55,19 +52,13 @@ class PILGL(GraphicsLayer):
self.background_grid = np.zeros(shape=(self.width, self.height)) self.background_grid = np.zeros(shape=(self.width, self.height))
if jupyter is False: if jupyter is False:
# NOTE: Currently removed the dependency on
# screeninfo. We have to find an alternate
# way to compute the screen width and height
# In the meantime, we are harcoding the 800x600
# assumption
self.screen_width = 800 self.screen_width = 800
self.screen_height = 600 self.screen_height = 600
if platform.system() == "Windows" or platform.system() == "Linux":
self.screen_width = 9999
self.screen_height = 9999
for m in get_monitors():
self.screen_height = min(self.screen_height, m.height)
self.screen_width = min(self.screen_width, m.width)
# Note: screeninfo doesnot have proper support for
# OSX yet, hence the default values of 800,600
# will be used for the same.
w = (self.screen_width - self.width - 10) / (self.width + 1 + self.linewidth) w = (self.screen_width - self.width - 10) / (self.width + 1 + self.linewidth)
h = (self.screen_height - self.height - 10) / (self.height + 1 + self.linewidth) h = (self.screen_height - self.height - 10) / (self.height + 1 + self.linewidth)
self.nPixCell = int(max(1, np.ceil(min(w, h)))) self.nPixCell = int(max(1, np.ceil(min(w, h))))
......
[bumpversion] [bumpversion]
current_version = 0.3.2 current_version = 0.3.3
commit = True commit = True
tag = True tag = True
......
...@@ -79,6 +79,6 @@ setup( ...@@ -79,6 +79,6 @@ setup(
test_suite='tests', test_suite='tests',
tests_require=test_requirements, tests_require=test_requirements,
url='https://gitlab.aicrowd.com/flatland/flatland', url='https://gitlab.aicrowd.com/flatland/flatland',
version='0.3.2', version='0.3.3',
zip_safe=False, zip_safe=False,
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment