Separated space/__init__.py
into a few modules
- `draw.py` contains all the drawing code - `global_state.py` contains the `G` class introduced in the previous commit.
This commit is contained in:
31
benchmark/space/global_state.py
Normal file
31
benchmark/space/global_state.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import threading
|
||||
|
||||
|
||||
class G:
|
||||
"""Global state of the Benchmark Client."""
|
||||
result_platform = None
|
||||
progress_status = None
|
||||
result_stats = None
|
||||
result_dict = None
|
||||
background_image_path = ""
|
||||
scene_status = {}
|
||||
cancel = False
|
||||
|
||||
cached_system_info = None
|
||||
cached_compute_devices = None
|
||||
results_submitted = False
|
||||
|
||||
images = {}
|
||||
current_progress = 0.0
|
||||
progress_lock = threading.Lock()
|
||||
|
||||
@classmethod
|
||||
def reset(cls):
|
||||
"""Reset the global state."""
|
||||
cls.result_platform = None
|
||||
cls.progress_status = None
|
||||
cls.result_stats = None
|
||||
cls.result_dict = None
|
||||
cls.background_image_path = ""
|
||||
cls.scene_status = {}
|
||||
cls.results_submitted = False
|
Reference in New Issue
Block a user