Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix env create #87

Merged
merged 9 commits into from
Jul 8, 2024
Merged

Fix env create #87

merged 9 commits into from
Jul 8, 2024

Conversation

epignatelli
Copy link
Owner

@epignatelli epignatelli commented Jul 8, 2024

Closes #86

Copy link
Contributor

github-actions bot commented Jul 8, 2024

************* Module navix._version
navix/_version.py:1:0: C0114: Missing module docstring (missing-module-docstring)
************* Module navix.environments.empty
navix/environments/empty.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/empty.py:39:0: C0115: Missing class docstring (missing-class-docstring)
************* Module navix.environments.key_corridor
navix/environments/key_corridor.py:1:0: C0114: Missing module docstring (missing-module-docstring)
navix/environments/key_corridor.py:41:0: C0115: Missing class docstring (missing-class-docstring)
navix/environments/key_corridor.py:42:4: R0914: Too many local variables (41/15) (too-many-locals)
navix/environments/key_corridor.py:79:30: W0622: Redefining built-in 'open' (redefined-builtin)
navix/environments/key_corridor.py:82:56: W0640: Cell variable k5 defined in loop (cell-var-from-loop)
navix/environments/key_corridor.py:76:24: W0612: Unused variable 'k8' (unused-variable)
navix/environments/key_corridor.py:100:21: W0612: Unused variable 'k11' (unused-variable)
************* 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:62:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:66:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:70:0: C0115: Missing class docstring (missing-class-docstring)
navix/rendering/registry.py:87:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:90:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:93:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:96:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:102:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:112:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:122:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:125:4: C0116: Missing function or method docstring (missing-function-docstring)
navix/rendering/registry.py:131:4: 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:15:24: W0212: Access to a protected member _reset of a client class (protected-access)
tests/test_environments.py:41:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:50:24: W0212: Access to a protected member _reset of a client class (protected-access)
tests/test_environments.py:84:0: C0116: Missing function or method docstring (missing-function-docstring)
tests/test_environments.py:88:15: W0212: Access to a protected member _reset of a client class (protected-access)
tests/test_environments.py:84:0: R1711: Useless return at end of function or method (useless-return)
tests/test_environments.py:88:4: W0612: Unused variable 'timestep' (unused-variable)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[69:79]
==navix.environments.key_corridor:[132:141]
        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_fn(state), (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[170:178]
==navix.environments.key_corridor:[201:209]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
)
register_env( (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[157:165]
==navix.environments.key_corridor:[189:197]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
)
register_env( (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[144:152]
==navix.environments.key_corridor:[177:185]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
)
register_env( (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[131:139]
==navix.environments.key_corridor:[165:173]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
)
register_env( (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[118:126]
==navix.environments.key_corridor:[153:161]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
)
register_env( (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[183:190]
==navix.environments.key_corridor:[153:160]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
) (duplicate-code)
tests/test_environments.py:1:0: R0801: Similar lines in 2 files
==navix.environments.empty:[118:125]
==navix.environments.key_corridor:[213:220]
        observation_fn=kwargs.pop("observation_fn", observations.symbolic),
        reward_fn=kwargs.pop("reward_fn", rewards.on_goal_reached),
        termination_fn=kwargs.pop("termination_fn", terminations.on_goal_reached),
        *args,
        **kwargs,
    ),
) (duplicate-code)


Report
======
213 statements analysed.

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

+---------+-------+-----------+-----------+------------+---------+
|type     |number |old number |difference |%documented |%badname |
+=========+=======+===========+===========+============+=========+
|module   |5      |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|class    |4      |NC         |NC         |0.00        |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|method   |15     |NC         |NC         |26.67       |0.00     |
+---------+-------+-----------+-----------+------------+---------+
|function |6      |NC         |NC         |50.00       |0.00     |
+---------+-------+-----------+-----------+------------+---------+



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

    navix (test_environments)
      \-components (navix.environments.empty,navix.environments.key_corridor)
      \-entities (navix.environments.empty,navix.environments.key_corridor)
      \-grid (navix.environments.empty,navix.environments.key_corridor)
      \-observations (navix.environments.empty,navix.environments.key_corridor)
      \-rendering 
      | \-cache (navix.environments.empty,navix.environments.key_corridor)
      \-rewards (navix.environments.empty,navix.environments.key_corridor)
      \-states (navix.environments.empty,navix.environments.key_corridor)
      \-terminations (navix.environments.empty,navix.environments.key_corridor)



677 lines have been analyzed

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

+----------+-------+------+---------+-----------+
|type      |number |%     |previous |difference |
+==========+=======+======+=========+===========+
|code      |489    |72.23 |NC       |NC         |
+----------+-------+------+---------+-----------+
|docstring |25     |3.69  |NC       |NC         |
+----------+-------+------+---------+-----------+
|comment   |78     |11.52 |NC       |NC         |
+----------+-------+------+---------+-----------+
|empty     |85     |12.56 |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 |23     |NC       |NC         |
+-----------+-------+---------+-----------+
|refactor   |10     |NC       |NC         |
+-----------+-------+---------+-----------+
|warning    |8      |NC       |NC         |
+-----------+-------+---------+-----------+
|error      |0      |NC       |NC         |
+-----------+-------+---------+-----------+



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

+--------------------------------+------+--------+---------+-----------+
|module                          |error |warning |refactor |convention |
+================================+======+========+=========+===========+
|test_environments               |0.00  |50.00   |90.00    |17.39      |
+--------------------------------+------+--------+---------+-----------+
|navix.environments.key_corridor |0.00  |50.00   |10.00    |8.70       |
+--------------------------------+------+--------+---------+-----------+
|navix.rendering.registry        |0.00  |0.00    |0.00     |60.87      |
+--------------------------------+------+--------+---------+-----------+
|navix.environments.empty        |0.00  |0.00    |0.00     |8.70       |
+--------------------------------+------+--------+---------+-----------+
|navix._version                  |0.00  |0.00    |0.00     |4.35       |
+--------------------------------+------+--------+---------+-----------+



Messages
--------

+---------------------------+------------+
|message id                 |occurrences |
+===========================+============+
|missing-function-docstring |14          |
+---------------------------+------------+
|duplicate-code             |8           |
+---------------------------+------------+
|missing-module-docstring   |5           |
+---------------------------+------------+
|missing-class-docstring    |4           |
+---------------------------+------------+
|unused-variable            |3           |
+---------------------------+------------+
|protected-access           |3           |
+---------------------------+------------+
|useless-return             |1           |
+---------------------------+------------+
|too-many-locals            |1           |
+---------------------------+------------+
|redefined-builtin          |1           |
+---------------------------+------------+
|cell-var-from-loop         |1           |
+---------------------------+------------+




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

@epignatelli epignatelli merged commit 73f924b into main Jul 8, 2024
3 checks passed
@epignatelli epignatelli deleted the fix-env-create branch July 8, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Environment.create fails with kwargs already in the signature
1 participant