Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sfwatergit
Flatland
Commits
71184d97
Commit
71184d97
authored
5 years ago
by
spmohanty
Browse files
Options
Downloads
Patches
Plain Diff
Remove screeninfo dependency
parent
f2d3ef43
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flatland/utils/graphics_pil.py
+5
-14
5 additions, 14 deletions
flatland/utils/graphics_pil.py
with
5 additions
and
14 deletions
flatland/utils/graphics_pil.py
+
5
−
14
View file @
71184d97
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
))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment