epignatelli / navix

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

Add API docs #74

Closed epignatelli closed 4 months ago

github-actions[bot] commented 4 months ago
************* Module docs.scripts.gen_doc_stubs
docs/scripts/gen_doc_stubs.py:36:0: C0303: Trailing whitespace (trailing-whitespace)
docs/scripts/gen_doc_stubs.py:11:0: C0103: Constant name "out" doesn't conform to UPPER_CASE naming style (invalid-name)
docs/scripts/gen_doc_stubs.py:41:8: C0103: Constant name "ident" doesn't conform to UPPER_CASE naming style (invalid-name)
************* Module navix._version
navix/_version.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.actions
navix/actions.py:300:0: C0301: Line too long (107/100) (line-too-long)
navix/actions.py:301:0: C0301: Line too long (119/100) (line-too-long)
navix/actions.py:337:0: C0301: Line too long (113/100) (line-too-long)
navix/actions.py:337:0: C0301: Line too long (113/100) (line-too-long)
navix/actions.py:248:0: W0622: Redefining built-in 'open' (redefined-builtin)
navix/actions.py:66:56: W0640: Cell variable k defined in loop (cell-var-from-loop)
navix/actions.py:224:14: W0612: Unused variable 'events' (unused-variable)
navix/actions.py:275:4: W0621: Redefining name 'open' from outer scope (line 248) (redefined-outer-name)
navix/actions.py:320:0: W0105: String statement has no effect (pointless-string-statement)
navix/actions.py:30:0: W0611: Unused Player imported from entities (unused-import)
************* Module navix.components
navix/components.py:54:0: C0301: Line too long (116/100) (line-too-long)
navix/components.py:94:0: C0301: Line too long (123/100) (line-too-long)
navix/components.py:101:0: C0301: Line too long (137/100) (line-too-long)
navix/components.py:108:0: C0301: Line too long (148/100) (line-too-long)
navix/components.py:112:0: C0301: Line too long (112/100) (line-too-long)
navix/components.py:117:0: C0301: Line too long (135/100) (line-too-long)
navix/components.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/components.py:38:0: C0116: Missing function or method docstring (missing-function-docstring)
navix/components.py:39:11: E3701: Invalid usage of field(), it should be used within a dataclass or the make_dataclass() function. (invalid-field-call)
navix/components.py:46:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/components.py:46:25: W0613: Unused argument 'batched' (unused-argument)
navix/components.py:42:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:50:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:57:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:64:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:71:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:83:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:93:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:100:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/components.py:120:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/components.py:28:0: C0411: standard import "dataclasses" should be placed before third party imports "jax.Array", "flax.struct", "jax.numpy" (wrong-import-order)
************* Module navix.config
navix/config.py:6:0: C0303: Trailing whitespace (trailing-whitespace)
navix/config.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/config.py:8:8: C0103: Attribute name "ARRAY_CHECKS_ENABLED" doesn't conform to snake_case naming style (invalid-name)
navix/config.py:10:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/config.py:13:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/config.py:14:8: C2801: Unnecessarily calls dunder method __init__. Instantiate class directly. (unnecessary-dunder-call)
************* Module navix.entities
navix/entities.py:81:0: C0301: Line too long (127/100) (line-too-long)
navix/entities.py:82:0: C0301: Line too long (117/100) (line-too-long)
navix/entities.py:88:0: C0301: Line too long (131/100) (line-too-long)
navix/entities.py:93:0: C0301: Line too long (140/100) (line-too-long)
navix/entities.py:98:0: C0301: Line too long (157/100) (line-too-long)
navix/entities.py:244:0: C0301: Line too long (105/100) (line-too-long)
navix/entities.py:245: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: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/entities.py:40:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/entities.py:55:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/entities.py:84:15: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:89:15: E1101: Instance of 'Field' has no 'ndim' member (no-member)
navix/entities.py:106:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:136:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:170:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:194:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:208:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:212:8: W0622: Redefining built-in 'id' (redefined-builtin)
navix/entities.py:232:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:251:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:256:8: W0622: Redefining built-in 'open' (redefined-builtin)
navix/entities.py:283:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:292:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:300:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:321:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:334:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:357:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
navix/entities.py:370:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/entities.py:393:30: E1101: Instance of 'Field' has no 'shape' member (no-member)
************* Module navix.events
navix/events.py:63:0: C0301: Line too long (108/100) (line-too-long)
navix/events.py:69:0: C0301: Line too long (136/100) (line-too-long)
navix/events.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.experiment
navix/experiment.py:52:0: C0301: Line too long (136/100) (line-too-long)
navix/experiment.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/experiment.py:35:4: R0913: Too many arguments (7/5) (too-many-arguments)
navix/experiment.py:87:47: W0640: Cell variable seed defined in loop (cell-var-from-loop)
navix/experiment.py:105:4: R0914: Too many local variables (25/15) (too-many-locals)
navix/experiment.py:125:53: W0640: Cell variable k defined in loop (cell-var-from-loop)
navix/experiment.py:129:20: C0121: Comparison 'member[0].metadata['pytree_node'] == False' should be 'member[0].metadata['pytree_node'] is False' if checking for the singleton value False, or 'not member[0].metadata['pytree_node']' if testing for falsiness (singleton-comparison)
navix/experiment.py:174:47: W0640: Cell variable i defined in loop (cell-var-from-loop)
navix/experiment.py:177:52: W0640: Cell variable i defined in loop (cell-var-from-loop)
************* Module navix.grid
navix/grid.py:483:0: C0301: Line too long (101/100) (line-too-long)
navix/grid.py:484:0: C0301: Line too long (123/100) (line-too-long)
navix/grid.py:494:0: C0301: Line too long (102/100) (line-too-long)
navix/grid.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/grid.py:51:38: W0621: Redefining name 'coordinates' from outer scope (line 36) (redefined-outer-name)
navix/grid.py:452:0: W0102: Dangerous default value {} as argument (dangerous-default-value)
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:37:9: W0613: Unused argument 'state' (unused-argument)
navix/observations.py:116:4: C0103: Variable name "H" doesn't conform to snake_case naming style (invalid-name)
navix/observations.py:116:7: C0103: Variable name "W" doesn't conform to snake_case naming style (invalid-name)
************* Module navix.rewards
navix/rewards.py:146:0: C0301: Line too long (106/100) (line-too-long)
navix/rewards.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/rewards.py:54:9: W0613: Unused argument 'state' (unused-argument)
navix/rewards.py:65:20: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:65:39: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:78:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:78:38: W0613: Unused argument 'new_state' (unused-argument)
navix/rewards.py:97:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:97:23: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:97:38: W0613: Unused argument 'new_state' (unused-argument)
navix/rewards.py:116:4: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:116:23: W0613: Unused argument 'action' (unused-argument)
navix/rewards.py:131:17: W0613: Unused argument 'prev_state' (unused-argument)
navix/rewards.py:131:36: W0613: Unused argument 'action' (unused-argument)
************* Module navix.spaces
navix/spaces.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/spaces.py:27:0: R0903: Too few public methods (1/2) (too-few-public-methods)
navix/spaces.py:55:0: C0115: Missing class docstring (missing-class-docstring)
navix/spaces.py:97:0: C0115: Missing class docstring (missing-class-docstring)
************* Module navix.states
navix/states.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/states.py:36:0: R0903: Too few public methods (0/2) (too-few-public-methods)
navix/states.py:115:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
navix/states.py:133:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return)
navix/states.py:375:41: W0613: Unused argument 'idx' (unused-argument)
navix/states.py:323:0: R0904: Too many public methods (22/20) (too-many-public-methods)
************* Module navix.terminations
navix/terminations.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/terminations.py:60:20: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:60:39: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:73:17: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:73:36: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:86:16: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:86:35: W0613: Unused argument 'action' (unused-argument)
navix/terminations.py:99:17: W0613: Unused argument 'prev_state' (unused-argument)
navix/terminations.py:99:36: W0613: Unused argument 'action' (unused-argument)
************* Module navix.transitions
navix/transitions.py:1:0: C0114: Missing module docstring (missing-module-docstring)

Report
======
1008 statements analysed.

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

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |15     |NC         |NC         |13.33       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |32     |NC         |NC         |93.75       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |101    |NC         |NC         |87.13       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |69     |NC         |NC         |98.55       |0.00     |
+---------+-------+-----------+-----------+------------+---------+

3072 lines have been analyzed

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

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |1355   |44.11 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |953    |31.02 |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |271    |8.82  |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |493    |16.05 |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 |63     |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |18     |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |39     |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |9      |NC       |NC         |
+-----------+-------+---------+-----------+

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

+---------------------------+------+--------+---------+-----------+
|module                     |error |warning |refactor |convention |
+===========================+======+========+=========+===========+
|navix.entities             |88.89 |5.13    |16.67    |26.98      |
+---------------------------+------+--------+---------+-----------+
|navix.components           |11.11 |2.56    |44.44    |17.46      |
+---------------------------+------+--------+---------+-----------+
|navix.rewards              |0.00  |30.77   |0.00     |3.17       |
+---------------------------+------+--------+---------+-----------+
|navix.terminations         |0.00  |20.51   |0.00     |1.59       |
+---------------------------+------+--------+---------+-----------+
|navix.actions              |0.00  |15.38   |0.00     |6.35       |
+---------------------------+------+--------+---------+-----------+
|navix.experiment           |0.00  |10.26   |11.11    |4.76       |
+---------------------------+------+--------+---------+-----------+
|navix.grid                 |0.00  |10.26   |0.00     |6.35       |
+---------------------------+------+--------+---------+-----------+
|navix.states               |0.00  |2.56    |22.22    |1.59       |
+---------------------------+------+--------+---------+-----------+
|navix.observations         |0.00  |2.56    |0.00     |4.76       |
+---------------------------+------+--------+---------+-----------+
|navix.spaces               |0.00  |0.00    |5.56     |4.76       |
+---------------------------+------+--------+---------+-----------+
|navix.config               |0.00  |0.00    |0.00     |9.52       |
+---------------------------+------+--------+---------+-----------+
|navix.events               |0.00  |0.00    |0.00     |4.76       |
+---------------------------+------+--------+---------+-----------+
|docs.scripts.gen_doc_stubs |0.00  |0.00    |0.00     |4.76       |
+---------------------------+------+--------+---------+-----------+
|navix.transitions          |0.00  |0.00    |0.00     |1.59       |
+---------------------------+------+--------+---------+-----------+
|navix._version             |0.00  |0.00    |0.00     |1.59       |
+---------------------------+------+--------+---------+-----------+

Messages
--------

+---------------------------+------------+
|message id                 |occurrences |
+===========================+============+
|line-too-long              |24          |
+---------------------------+------------+
|unused-argument            |23          |
+---------------------------+------------+
|missing-function-docstring |14          |
+---------------------------+------------+
|too-few-public-methods     |13          |
+---------------------------+------------+
|missing-module-docstring   |13          |
+---------------------------+------------+
|no-member                  |8           |
+---------------------------+------------+
|invalid-name               |5           |
+---------------------------+------------+
|cell-var-from-loop         |5           |
+---------------------------+------------+
|unused-import              |3           |
+---------------------------+------------+
|redefined-builtin          |3           |
+---------------------------+------------+
|trailing-whitespace        |2           |
+---------------------------+------------+
|redefined-outer-name       |2           |
+---------------------------+------------+
|no-else-return             |2           |
+---------------------------+------------+
|missing-class-docstring    |2           |
+---------------------------+------------+
|wrong-import-order         |1           |
+---------------------------+------------+
|unused-variable            |1           |
+---------------------------+------------+
|unnecessary-dunder-call    |1           |
+---------------------------+------------+
|too-many-public-methods    |1           |
+---------------------------+------------+
|too-many-locals            |1           |
+---------------------------+------------+
|too-many-arguments         |1           |
+---------------------------+------------+
|singleton-comparison       |1           |
+---------------------------+------------+
|pointless-string-statement |1           |
+---------------------------+------------+
|invalid-field-call         |1           |
+---------------------------+------------+
|dangerous-default-value    |1           |
+---------------------------+------------+

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