epignatelli / navix

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

Implement environments #54

Closed epignatelli closed 5 months ago

epignatelli commented 8 months ago

Partially solves #10

github-actions[bot] commented 8 months ago
************* Module navix
navix/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix._version
navix/_version.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:169:0: W0622: Redefining built-in 'open' (redefined-builtin)
navix/actions.py:33:0: C0115: Missing class docstring (missing-class-docstring)
navix/actions.py:33:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/actions.py:70:56: W0640: Cell variable k defined in loop (cell-var-from-loop)
navix/actions.py:95:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:99:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:103:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:107:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:112:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:117:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:122:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:127:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:161:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:165:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:191:4: W0621: Redefining name 'open' from outer scope (line 169) (redefined-outer-name)
navix/actions.py:215:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/actions.py:228:0: W0105: String statement has no effect (pointless-string-statement)
navix/actions.py:25:0: W0611: Unused jax.tree_util imported as jtu (unused-import)
************* Module navix.entities
navix/entities.py:64:0: C0301: Line too long (105/100) (line-too-long)
navix/entities.py:228:0: C0301: Line too long (105/100) (line-too-long)
navix/entities.py:229:0: C0301: Line too long (112/100) (line-too-long)
navix/entities.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/entities.py:26:0: C0115: Missing class docstring (missing-class-docstring)
navix/entities.py:26:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/entities.py:70:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:76:15: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:79:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:80:15: E1101: Instance of 'Field' has no 'ndim' member (no-member)
navix/entities.py:83:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:87:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:95:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:123:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:157:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:179:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:193:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:197:8: W0622: Redefining built-in 'id' (redefined-builtin)
navix/entities.py:216:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:235:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:240:8: W0622: Redefining built-in 'open' (redefined-builtin)
navix/entities.py:266:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:275:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:283:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:304:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:317:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:340:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:353:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:376:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
************* Module navix.environments
navix/environments/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.environments.crossings
navix/environments/crossings.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/crossings.py:37:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/crossings.py:41:4: R0914: Too many local variables (24/15) (too-many-locals)
navix/environments/crossings.py:104:12: W0612: Unused variable 'i' (unused-variable)
navix/environments/crossings.py:105:16: W0612: Unused variable 'k3' (unused-variable)
navix/environments/crossings.py:33:0: W0611: Unused room imported from grid (unused-import)
************* Module navix.environments.dist_shift
navix/environments/dist_shift.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/dist_shift.py:37:0: C0115: Missing class docstring (missing-class-docstring)
************* Module navix.environments.dynamic_obstacles
navix/environments/dynamic_obstacles.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/dynamic_obstacles.py:39:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/dynamic_obstacles.py:43:4: R0914: Too many local variables (17/15) (too-many-locals)
************* Module navix.environments.environment
navix/environments/environment.py:53:0: C0301: Line too long (105/100) (line-too-long)
navix/environments/environment.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/environment.py:36:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/environment.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/environments/environment.py:47:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/environment.py:47:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/environments/environment.py:64:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/environment.py:87:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:88:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
navix/environments/environment.py:88:11: W0143: Comparing against a callable, did you omit the parenthesis? (comparison-with-callable)
navix/environments/environment.py:90:13: W0143: Comparing against a callable, did you omit the parenthesis? (comparison-with-callable)
navix/environments/environment.py:92:13: W0143: Comparing against a callable, did you omit the parenthesis? (comparison-with-callable)
navix/environments/environment.py:95:13: W0143: Comparing against a callable, did you omit the parenthesis? (comparison-with-callable)
navix/environments/environment.py:101:13: W0143: Comparing against a callable, did you omit the parenthesis? (comparison-with-callable)
navix/environments/environment.py:110:16: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
navix/environments/environment.py:116:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:120:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:123:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:172:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:175:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/environment.py:178:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.environments.four_rooms
navix/environments/four_rooms.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/four_rooms.py:43:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/four_rooms.py:44:4: R0914: Too many local variables (20/15) (too-many-locals)
************* Module navix.environments.go_to_door
navix/environments/go_to_door.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/go_to_door.py:39:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/go_to_door.py:42:4: R0914: Too many local variables (30/15) (too-many-locals)
navix/environments/go_to_door.py:78:8: W0622: Redefining built-in 'open' (redefined-builtin)
************* Module navix.environments.key_corridor
navix/environments/key_corridor.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/key_corridor.py:39:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/key_corridor.py:40:4: R0914: Too many local variables (41/15) (too-many-locals)
navix/environments/key_corridor.py:77:30: W0622: Redefining built-in 'open' (redefined-builtin)
navix/environments/key_corridor.py:80:56: W0640: Cell variable k5 defined in loop (cell-var-from-loop)
navix/environments/key_corridor.py:74:24: W0612: Unused variable 'k8' (unused-variable)
navix/environments/key_corridor.py:98:21: W0612: Unused variable 'k11' (unused-variable)
************* Module navix.environments.key_door
navix/environments/key_door.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/key_door.py:38:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/key_door.py:41:4: R0914: Too many local variables (29/15) (too-many-locals)
************* Module navix.environments.lava_gap
navix/environments/lava_gap.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/lava_gap.py:37:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/lava_gap.py:38:4: R0914: Too many local variables (19/15) (too-many-locals)
************* Module navix.environments.registry
navix/environments/registry.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/registry.py:31:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/environments/registry.py:35:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.environments.room
navix/environments/room.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/room.py:38:0: C0115: Missing class docstring (missing-class-docstring)
************* Module navix.events
navix/events.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/events.py:29:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/events.py:33:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/events.py:37:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/events.py:41:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/events.py:59:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.grid
navix/grid.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/grid.py:36:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:40:38: W0621: Redefining name 'coordinates' from outer scope (line 36) (redefined-outer-name)
navix/grid.py:73:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:85:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:89:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:93:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:97:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:101:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:114:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:125:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:129:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:133:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:162:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:175:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:188:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:220:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:243:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:243:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
navix/grid.py:258:0: C0115: Missing class docstring (missing-class-docstring)
navix/grid.py:263:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:278:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:291:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/grid.py:25:0: W0611: Unused List imported from typing (unused-import)
navix/grid.py:29:0: W0611: Unused jax.tree_util imported as jtu (unused-import)
************* Module navix.observations
navix/observations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/observations.py:36:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:37:4: W0613: Unused argument 'state' (unused-argument)
navix/observations.py:42:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:56:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:79:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/observations.py:102:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.rendering
navix/rendering/__init__.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.rendering.cache
navix/rendering/cache.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/rendering/cache.py:33:0: C0115: Missing class docstring (missing-class-docstring)
navix/rendering/cache.py:38:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/cache.py:33:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/rendering/cache.py:53:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/cache.py:53:0: W0102: Dangerous default value SPRITES_REGISTRY (builtins.dict) as argument (dangerous-default-value)
navix/rendering/cache.py:80:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/cache.py:98:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.rendering.registry
navix/rendering/registry.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/rendering/registry.py:52:0: C0115: Missing class docstring (missing-class-docstring)
navix/rendering/registry.py:61:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:65:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:69:0: C0115: Missing class docstring (missing-class-docstring)
navix/rendering/registry.py:86:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:89:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:92:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:95:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:101:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:111:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:121:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:124:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:130:4: C0116: Missing function or method docstring (missing-function-docstring)
************* Module navix.rewards
navix/rewards.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/rewards.py:30:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:41:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:41:9: W0613: Unused argument 'state' (unused-argument)
navix/rewards.py:45:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:45:20: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:45:39: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:50:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:50:38: W0613: Unused argument 'new_state' (unused-argument)
navix/rewards.py:56:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:57:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:57:23: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:57:38: W0613: Unused argument 'new_state' (unused-argument)
navix/rewards.py:63:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:64:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:64:23: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:69:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/rewards.py:70:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:70:23: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:70:52: W0613: Unused argument 'cost' (unused-argument)
************* Module navix.states
navix/states.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/states.py:35:0: C0115: Missing class docstring (missing-class-docstring)
navix/states.py:35:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/states.py:45:0: C0115: Missing class docstring (missing-class-docstring)
navix/states.py:61:0: C0115: Missing class docstring (missing-class-docstring)
navix/states.py:71:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:72:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
navix/states.py:80:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:81:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
navix/states.py:87:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:99:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:111:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:123:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:133:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:145:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:157:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:169:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:181:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:211:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:214:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:218:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:221:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:225:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:228:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:228:41: W0613: Unused argument 'idx' (unused-argument)
navix/states.py:233:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:236:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:240:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:243:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:247:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:250:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:254:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:257:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:260:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:263:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:267:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:271:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:274:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:277:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:280:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:283:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/states.py:194:0: R0904: Too many public methods (22/20) (too-many-public-methods)
************* Module navix.tasks
navix/tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/tasks.py:9:0: R0903: Too few public methods (0/2) (too-few-public-methods)
************* Module navix.terminations
navix/terminations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/terminations.py:31:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:40:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:45:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:45:20: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:45:39: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:49:17: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:49:36: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:53:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:53:16: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:53:35: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:57:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/terminations.py:57:17: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:57:36: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:27:0: W0611: Unused translate imported from grid (unused-import)
navix/terminations.py:28:0: W0611: Unused Entities imported from entities (unused-import)
navix/terminations.py:28:0: W0611: Unused Player imported from entities (unused-import)
************* Module navix.transitions
navix/transitions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/transitions.py:33:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/transitions.py:39:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/transitions.py:49:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/transitions.py:63:30: W0108: Lambda may not be necessary (unnecessary-lambda)
navix/transitions.py:79:59: W0640: Cell variable k defined in loop (cell-var-from-loop)
************* Module test_actions
tests/test_actions.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_actions.py:13:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:37:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:42:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:47:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:52:12: W0212: Access to a protected member _rotate of a client class (protected-access)
tests/test_actions.py:13:0: R1711: Useless return at end of function or method (useless-return)
tests/test_actions.py:59:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:84:4: W0105: String statement has no effect (pointless-string-statement)
tests/test_actions.py:59:0: R0915: Too many statements (57/50) (too-many-statements)
tests/test_actions.py:159:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:184:4: W0105: String statement has no effect (pointless-string-statement)
tests/test_actions.py:208:22: W0212: Access to a protected member _can_walk_there of a client class (protected-access)
tests/test_actions.py:211:11: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:246:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:267:4: W0105: String statement has no effect (pointless-string-statement)
tests/test_actions.py:292:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:305:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:311:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:314:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_actions.py:365:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:375:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:387:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:398:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:409:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:418:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:427:7: C0209: Formatting a regular string which could be an f-string (consider-using-f-string)
tests/test_actions.py:314:0: R0915: Too many statements (52/50) (too-many-statements)
************* Module test_entities
tests/test_entities.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_entities.py:8:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_entities.py:19:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module 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:36:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:74:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:74:0: R1711: Useless return at end of function or method (useless-return)
tests/test_environments.py:78:4: W0612: Unused variable 'timestep' (unused-variable)
************* Module test_observations
tests/test_observations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_observations.py:12:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_observations.py:12:0: R0914: Too many local variables (21/15) (too-many-locals)
tests/test_observations.py:12:0: R1711: Useless return at end of function or method (useless-return)
tests/test_observations.py:99:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module test_spaces
tests/test_spaces.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_spaces.py:6:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_spaces.py:20:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module test_tasks
tests/test_tasks.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_tasks.py:50:0: C0116: Missing function or method docstring (missing-function-docstring)
************* Module test_terminations
tests/test_terminations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
tests/test_terminations.py:10:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_terminations.py:38:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.key_door:[115:134]
==navix.environments.lava_gap:[75:94]
        }

        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )
        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(-1, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.four_rooms:[85:106]
==navix.environments.room:[65:86]
        }

        # systems
        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )

        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(0, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dist_shift:[66:87]
==navix.environments.dynamic_obstacles:[78:99]
        }

        # systems
        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )

        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(0, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.key_corridor:[130:147]
==navix.environments.key_door:[117:134]
        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )
        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(-1, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.crossings:[114:127]
==navix.environments.key_corridor:[134:147]
            entities=entities,
        )
        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(-1, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dynamic_obstacles:[78:91]
==navix.environments.lava_gap:[75:86]
        }

        # systems
        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )

        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state), (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dist_shift:[66:79]
==navix.environments.key_door:[115:126]
        }

        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )
        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state), (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dist_shift:[74:87]
==navix.environments.go_to_door:[104:117]
        )

        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state),
            action=jnp.asarray(0, dtype=jnp.int32),
            reward=jnp.asarray(0.0, dtype=jnp.float32),
            step_type=jnp.asarray(0, dtype=jnp.int32),
            state=state,
        )

register_env( (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==test_observations:[108:117]
==test_tasks:[23:33]
    keys = Key(position=jnp.asarray((2, 2)), id=jnp.asarray(0), colour=PALETTE.YELLOW)
    doors = Door(
        position=jnp.asarray([(1, 5), (1, 6)]),
        requires=jnp.asarray((0, 0)),
        open=jnp.asarray((False, True)),
        colour=PALETTE.YELLOW,
    )
    entities = {
        Entities.PLAYER: players[None], (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.four_rooms:[73:84]
==navix.environments.room:[54:65]
        player = Player(
            position=player_pos,
            direction=direction,
            pocket=EMPTY_POCKET_ID,
        )
        # goal
        goal = Goal(position=goal_pos, probability=jnp.asarray(1.0))

        entities = {
            Entities.PLAYER: player[None],
            Entities.GOAL: goal[None], (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dist_shift:[69:79]
==navix.environments.key_corridor:[130:139]
        state = State(
            key=key,
            grid=grid,
            cache=cache or RenderingCache.init(grid),
            entities=entities,
        )

        return Timestep(
            t=jnp.asarray(0, dtype=jnp.int32),
            observation=self.observation(state), (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==test_tasks:[36:44]
==test_terminations:[19:28]
    }

    state = State(
        key=jax.random.PRNGKey(0),
        grid=grid,
        cache=nx.rendering.cache.RenderingCache.init(grid),
        entities=entities,
    )
    # should not terminate (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==test_observations:[12:20]
==test_tasks:[12:20]
    height = 10
    width = 10
    grid = jnp.zeros((height - 2, width - 2), dtype=jnp.int32)
    grid = jnp.pad(grid, 1, mode="constant", constant_values=-1)

    players = Player(
        position=jnp.asarray((1, 1)), direction=jnp.asarray(0), pocket=EMPTY_POCKET_ID
    ) (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.dist_shift:[44:52]
==navix.environments.dynamic_obstacles:[53:62]
            player_pos = jnp.asarray([1, 1])
            direction = jnp.asarray(0)
        # player
        player = Player(
            position=player_pos,
            direction=direction,
            pocket=EMPTY_POCKET_ID,
        )
        # goal (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.crossings:[51:60]
==navix.environments.lava_gap:[51:61]
        player_pos = jnp.asarray([1, 1])
        player_dir = jnp.asarray(0)
        player = Player(
            position=player_pos, direction=player_dir, pocket=EMPTY_POCKET_ID
        )
        # goal
        goal_pos = jnp.asarray([self.height - 2, self.width - 2])
        goals = Goal(position=goal_pos, probability=jnp.asarray(1.0))

        # lava positions (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==test_observations:[32:39]
==test_tasks:[34:41]
        Entities.KEY: keys[None],
        Entities.DOOR: doors,
    }

    state = State(
        key=jax.random.PRNGKey(0),
        grid=grid, (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.key_door:[42:49]
==navix.environments.lava_gap:[39:46]
        assert (
            self.height > 3
        ), f"Room height must be greater than 3, got {self.height} instead"
        assert (
            self.width > 4
        ), f"Room width must be greater than 5, got {self.width} instead"
 (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==test_observations:[21:26]
==test_tasks:[23:28]
    keys = Key(position=jnp.asarray((2, 2)), id=jnp.asarray(0), colour=PALETTE.YELLOW)
    doors = Door(
        position=jnp.asarray([(1, 5), (1, 6)]),
        requires=jnp.asarray((0, 0)),
        open=jnp.asarray((False, True)), (duplicate-code)
tests/test_terminations.py:1:0: R0801: Similar lines in 2 files
==navix.environments.crossings:[110:115]
==navix.environments.go_to_door:[98:103]
        state = State(
            key=key,
            grid=grid,
            cache=RenderingCache.init(grid),
            entities=entities, (duplicate-code)
tests/test_terminations.py:1:0: R0401: Cyclic import (navix.environments -> navix.environments.key_corridor) (cyclic-import)
tests/test_terminations.py:1:0: R0401: Cyclic import (navix.environments -> navix.environments.crossings) (cyclic-import)
tests/test_terminations.py:1:0: R0401: Cyclic import (navix.environments -> navix.environments.key_door) (cyclic-import)
tests/test_terminations.py:1:0: R0401: Cyclic import (navix.environments -> navix.environments.lava_gap) (cyclic-import)

Report
======
1787 statements analysed.

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

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |34     |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |32     |NC         |NC         |34.38       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |118    |NC         |NC         |42.37       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |96     |NC         |NC         |21.88       |0.00     |
+---------+-------+-----------+-----------+------------+---------+

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

    navix (test_actions,test_environments,test_observations,test_tasks,test_terminations)
      \-actions (navix.environments.environment,test_actions,test_terminations)
      \-components (navix.environments.crossings,navix.environments.dist_shift,navix.environments.dynamic_obstacles,navix.environments.four_rooms,navix.environments.go_to_door,navix.environments.key_corridor,navix.environments.key_door,navix.environments.lava_gap,navix.environments.room,test_actions,test_observations,test_tasks,test_terminations)
      \-entities (navix.environments.crossings,navix.environments.dist_shift,navix.environments.dynamic_obstacles,navix.environments.four_rooms,navix.environments.go_to_door,navix.environments.key_corridor,navix.environments.key_door,navix.environments.lava_gap,navix.environments.room,test_actions,test_entities,test_observations,test_tasks)
      \-grid (navix.environments.crossings,navix.environments.dist_shift,navix.environments.dynamic_obstacles,navix.environments.four_rooms,navix.environments.go_to_door,navix.environments.key_corridor,navix.environments.key_door,navix.environments.lava_gap,navix.environments.room)
      \-observations (navix.environments.environment)
      \-rendering 
      | \-cache (navix.environments.crossings,navix.environments.dist_shift,navix.environments.dynamic_obstacles,navix.environments.environment,navix.environments.four_rooms,navix.environments.go_to_door,navix.environments.key_corridor,navix.environments.key_door,navix.environments.lava_gap,navix.environments.room,test_observations)
      | \-registry (navix.environments.dynamic_obstacles,navix.environments.key_door,test_actions,test_entities,test_observations,test_tasks)
      \-rewards (navix.environments.environment,navix.environments.go_to_door)
      \-spaces (navix.environments.environment,test_spaces)
      \-states (navix.environments.crossings,navix.environments.dist_shift,navix.environments.dynamic_obstacles,navix.environments.environment,navix.environments.four_rooms,navix.environments.go_to_door,navix.environments.key_corridor,navix.environments.key_door,navix.environments.lava_gap,navix.environments.registry,navix.environments.room,test_actions,test_observations,test_tasks,test_terminations)
      \-terminations (navix.environments.environment,navix.environments.go_to_door)
      \-transitions (navix.environments.environment)

4503 lines have been analyzed

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

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |2891   |64.20 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |203    |4.51  |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |594    |13.19 |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |815    |18.10 |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 |214    |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |47     |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |62     |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |8      |NC       |NC         |
+-----------+-------+---------+-----------+

% errors / warnings by module
-----------------------------

+-------------------------------------+-------+--------+---------+-----------+
|module                               |error  |warning |refactor |convention |
+=====================================+=======+========+=========+===========+
|navix.entities                       |100.00 |3.23    |2.13     |8.41       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.rewards                        |0.00   |20.97   |0.00     |3.74       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.terminations                   |0.00   |17.74   |0.00     |3.27       |
+-------------------------------------+-------+--------+---------+-----------+
|test_actions                         |0.00   |12.90   |6.38     |7.94       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.environment       |0.00   |8.06    |6.38     |6.07       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.actions                        |0.00   |8.06    |2.13     |6.07       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.key_corridor      |0.00   |6.45    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.grid                           |0.00   |6.45    |0.00     |9.81       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.crossings         |0.00   |4.84    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.transitions                    |0.00   |3.23    |0.00     |1.87       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.states                         |0.00   |1.61    |8.51     |17.29      |
+-------------------------------------+-------+--------+---------+-----------+
|navix.rendering.cache                |0.00   |1.61    |2.13     |2.80       |
+-------------------------------------+-------+--------+---------+-----------+
|test_environments                    |0.00   |1.61    |2.13     |1.87       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.go_to_door        |0.00   |1.61    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.observations                   |0.00   |1.61    |0.00     |2.80       |
+-------------------------------------+-------+--------+---------+-----------+
|test_terminations                    |0.00   |0.00    |48.94    |1.40       |
+-------------------------------------+-------+--------+---------+-----------+
|test_observations                    |0.00   |0.00    |4.26     |1.40       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.lava_gap          |0.00   |0.00    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.key_door          |0.00   |0.00    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.four_rooms        |0.00   |0.00    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.dynamic_obstacles |0.00   |0.00    |2.13     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.tasks                          |0.00   |0.00    |2.13     |0.47       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.rendering.registry             |0.00   |0.00    |0.00     |6.54       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.events                         |0.00   |0.00    |0.00     |2.80       |
+-------------------------------------+-------+--------+---------+-----------+
|test_spaces                          |0.00   |0.00    |0.00     |1.40       |
+-------------------------------------+-------+--------+---------+-----------+
|test_entities                        |0.00   |0.00    |0.00     |1.40       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.registry          |0.00   |0.00    |0.00     |1.40       |
+-------------------------------------+-------+--------+---------+-----------+
|test_tasks                           |0.00   |0.00    |0.00     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.room              |0.00   |0.00    |0.00     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.dist_shift        |0.00   |0.00    |0.00     |0.93       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.rendering.__init__             |0.00   |0.00    |0.00     |0.47       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.environments.__init__          |0.00   |0.00    |0.00     |0.47       |
+-------------------------------------+-------+--------+---------+-----------+
|navix._version                       |0.00   |0.00    |0.00     |0.47       |
+-------------------------------------+-------+--------+---------+-----------+
|navix.__init__                       |0.00   |0.00    |0.00     |0.47       |
+-------------------------------------+-------+--------+---------+-----------+

Messages
--------

+---------------------------+------------+
|message id                 |occurrences |
+===========================+============+
|missing-function-docstring |143         |
+---------------------------+------------+
|missing-module-docstring   |34          |
+---------------------------+------------+
|unused-argument            |23          |
+---------------------------+------------+
|missing-class-docstring    |21          |
+---------------------------+------------+
|duplicate-code             |19          |
+---------------------------+------------+
|consider-using-f-string    |12          |
+---------------------------+------------+
|too-many-locals            |8           |
+---------------------------+------------+
|no-member                  |8           |
+---------------------------+------------+
|unused-import              |7           |
+---------------------------+------------+
|too-few-public-methods     |7           |
+---------------------------+------------+
|unused-variable            |5           |
+---------------------------+------------+
|redefined-builtin          |5           |
+---------------------------+------------+
|protected-access           |5           |
+---------------------------+------------+
|comparison-with-callable   |5           |
+---------------------------+------------+
|pointless-string-statement |4           |
+---------------------------+------------+
|line-too-long              |4           |
+---------------------------+------------+
|cyclic-import              |4           |
+---------------------------+------------+
|useless-return             |3           |
+---------------------------+------------+
|no-else-return             |3           |
+---------------------------+------------+
|cell-var-from-loop         |3           |
+---------------------------+------------+
|too-many-statements        |2           |
+---------------------------+------------+
|redefined-outer-name       |2           |
+---------------------------+------------+
|dangerous-default-value    |2           |
+---------------------------+------------+
|unnecessary-lambda         |1           |
+---------------------------+------------+
|too-many-public-methods    |1           |
+---------------------------+------------+

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