epignatelli / navix

Accelerated minigrid environments with JAX
Apache License 2.0
116 stars 10 forks source link

Towards a more rigorous ECS design pattern and add the KeyDoor environment #14

Closed epignatelli closed 1 year ago

epignatelli commented 1 year ago

Performance gains from the new design pattern 10x. EmptyRoom16x16 is not 10k times faster than minigrid

github-actions[bot] commented 1 year ago
************* Module navix
navix/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.actions
navix/actions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/actions.py:116:0: W0622: Redefining built-in 'open' (redefined-builtin)
navix/actions.py:58:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:69:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:73:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:77:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:81:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:85:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:89:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:93:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:97:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:116:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:23:0: W0611: Unused import chex (unused-import)
************* Module navix.components
navix/components.py:35:0: C0301: Line too long (101/100) (line-too-long)
navix/components.py:107:0: C0301: Line too long (105/100) (line-too-long)
navix/components.py:108:0: C0301: Line too long (112/100) (line-too-long)
navix/components.py:150:0: C0301: Line too long (105/100) (line-too-long)
navix/components.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/components.py:32:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:81:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:90:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:96:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:104:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:118:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:135:0: C0115: Missing class docstring (missing-class-docstring)
navix/components.py:144:0: C0115: Missing class docstring (missing-class-docstring)
navix/components.py:144:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/components.py:28:0: C0412: Imports from package jax are not grouped (ungrouped-imports)
************* Module navix.environments
navix/environments/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.environments.environment
navix/environments/environment.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/environment.py:38:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/environment.py:54:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:57:4: W0102: Dangerous default value ACTIONS (builtins.dict) as argument (dangerous-default-value)
navix/environments/environment.py:71:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:71:4: W0102: Dangerous default value ACTIONS (builtins.dict) as argument (dangerous-default-value)
navix/environments/environment.py:81:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:84:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:87:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:88:62: C0103: Argument name "t" doesn't conform to snake_case naming style (invalid-name)
navix/environments/environment.py:32:0: W0611: Unused StepType imported from components (unused-import)
************* Module navix.environments.keydoor
navix/environments/keydoor.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/keydoor.py:9:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/keydoor.py:10:4: R0914: Too many local variables (18/15) (too-many-locals)
navix/environments/keydoor.py:11:13: C0103: Variable name "k1" doesn't conform to snake_case naming style (invalid-name)
navix/environments/keydoor.py:11:17: C0103: Variable name "k2" doesn't conform to snake_case naming style (invalid-name)
navix/environments/keydoor.py:11:21: C0103: Variable name "k3" doesn't conform to snake_case naming style (invalid-name)
************* Module navix.environments.room
navix/environments/room.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/room.py:32:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/room.py:34:13: C0103: Variable name "k1" doesn't conform to snake_case naming style (invalid-name)
navix/environments/room.py:34:17: C0103: Variable name "k2" doesn't conform to snake_case naming style (invalid-name)
************* Module navix.grid
navix/grid.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/grid.py:34:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:47:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:47:49: C0103: Argument name "n" doesn't conform to snake_case naming style (invalid-name)
navix/grid.py:56:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:56:37: C0103: Argument name "n" doesn't conform to snake_case naming style (invalid-name)
navix/grid.py:60:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:60:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
************* Module navix.observations
navix/observations.py:41:0: C0301: Line too long (109/100) (line-too-long)
navix/observations.py:43:0: C0301: Line too long (112/100) (line-too-long)
navix/observations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/observations.py:30:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:34:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:38:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:51:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:55:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.tasks
navix/tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/tasks.py:32:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/tasks.py:35:12: C0103: Variable name "fn" doesn't conform to snake_case naming style (invalid-name)
navix/tasks.py:42:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/tasks.py:42:9: W0613: Unused argument 'state' (unused-argument)
navix/tasks.py:46:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/tasks.py:46:15: W0613: Unused argument 'prev_state' (unused-argument)
navix/tasks.py:46:34: W0613: Unused argument 'action' (unused-argument)
navix/tasks.py:61:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/tasks.py:62:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/tasks.py:62:38: W0613: Unused argument 'new_state' (unused-argument)
navix/tasks.py:68:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/tasks.py:69:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/tasks.py:69:23: W0613: Unused argument 'action' (unused-argument)
navix/tasks.py:69:38: W0613: Unused argument 'new_state' (unused-argument)
navix/tasks.py:75:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.terminations
navix/terminations.py:34:0: C0301: Line too long (103/100) (line-too-long)
navix/terminations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/terminations.py:29:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:33:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:33:29: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:33:48: W0613: Unused argument 'action' (unused-argument)
************* Module tests.test_actions
tests/test_actions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_actions.py:7:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:17:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:20:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:23:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:26:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:7:0: R1711: Useless return at end of function or method (useless-return)
************* Module tests.test_environments
tests/test_environments.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_environments.py:6:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:7:4: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
tests/test_environments.py:36:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:37:4: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
tests/test_environments.py:66:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:67:4: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
tests/test_environments.py:91:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:92:4: C0103: Function name "f" doesn't conform to snake_case naming style (invalid-name)
************* Module tests.test_grid
tests/test_grid.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_grid.py:4:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module tests.test_tasks
tests/test_tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_tasks.py:5:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_tasks.py:1:0: R0401: Cyclic import (navix.environments -> navix.environments.keydoor) (cyclic-import)

Report
======
416 statements analysed.

Statistics by type
------------------

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |15     |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |11     |NC         |NC         |54.55       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |8      |NC         |NC         |37.50       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |46     |NC         |NC         |26.09       |8.70     |
+---------+-------+-----------+-----------+------------+---------+

External dependencies
---------------------
::

    navix (tests.test_actions,tests.test_environments,tests.test_grid,tests.test_tasks)
      \-actions (navix.environments.environment)
      \-components (navix.environments.environment,navix.environments.keydoor,navix.environments.room)
      \-grid (navix.environments.keydoor,navix.environments.room)
      \-observations (navix.environments.environment)
      \-tasks (navix.environments.environment)
      \-terminations (navix.environments.environment)

1065 lines have been analyzed

Raw metrics
-----------

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |558    |52.39 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |37     |3.47  |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |219    |20.56 |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |251    |23.57 |NC       |NC         |
+----------+-------+------+---------+-----------+

Duplication
-----------

+-------------------------+------+---------+-----------+
|                         |now   |previous |difference |
+=========================+======+=========+===========+
|nb duplicated lines      |0     |NC       |NC         |
+-------------------------+------+---------+-----------+
|percent duplicated lines |0.000 |NC       |NC         |
+-------------------------+------+---------+-----------+

Messages by category
--------------------

+-----------+-------+---------+-----------+
|type       |number |previous |difference |
+===========+=======+=========+===========+
|convention |80     |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |10     |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |20     |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |0      |NC       |NC         |
+-----------+-------+---------+-----------+

Messages
--------

+---------------------------+------------+
|message id                 |occurrences |
+===========================+============+
|missing-function-docstring |39          |
+---------------------------+------------+
|missing-module-docstring   |15          |
+---------------------------+------------+
|invalid-name               |13          |
+---------------------------+------------+
|unused-argument            |10          |
+---------------------------+------------+
|too-few-public-methods     |7           |
+---------------------------+------------+
|line-too-long              |7           |
+---------------------------+------------+
|missing-class-docstring    |5           |
+---------------------------+------------+
|protected-access           |4           |
+---------------------------+------------+
|dangerous-default-value    |3           |
+---------------------------+------------+
|unused-import              |2           |
+---------------------------+------------+
|useless-return             |1           |
+---------------------------+------------+
|ungrouped-imports          |1           |
+---------------------------+------------+
|too-many-locals            |1           |
+---------------------------+------------+
|redefined-builtin          |1           |
+---------------------------+------------+
|cyclic-import              |1           |
+---------------------------+------------+

-----------------------------------
Your code has been rated at 7.36/10