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

Create TypedDict file for the json schema #279

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

henriquegemignani
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Attention: 48 lines in your changes are missing coverage. Please review.

Comparison is base (3898b42) 87.71% compared to head (88bad8e) 85.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #279      +/-   ##
==========================================
- Coverage   87.71%   85.85%   -1.86%     
==========================================
  Files          35       35              
  Lines        1937     1987      +50     
==========================================
+ Hits         1699     1706       +7     
- Misses        238      281      +43     
Files Coverage Δ
src/open_dread_rando/misc_patches/exefs.py 100.00% <100.00%> (ø)
src/open_dread_rando/dread_patcher.py 92.26% <94.73%> (-0.56%) ⬇️
src/open_dread_rando/misc_patches/text_patches.py 96.00% <83.33%> (-1.96%) ⬇️
src/open_dread_rando/pickups/lua_editor.py 98.55% <88.88%> (-1.45%) ⬇️
src/open_dread_rando/pickups/map_icons.py 88.37% <75.00%> (-1.04%) ⬇️
src/open_dread_rando/cosmetic_patches/__init__.py 84.61% <71.42%> (-15.39%) ⬇️
...c/open_dread_rando/door_locks/custom_door_types.py 97.67% <75.00%> (-2.33%) ⬇️
...open_dread_rando/misc_patches/tilegroup_patcher.py 78.57% <75.00%> (-11.43%) ⬇️
.../open_dread_rando/specific_patches/game_patches.py 79.36% <71.42%> (-2.00%) ⬇️
src/open_dread_rando/specific_patches/objective.py 93.02% <71.42%> (-4.42%) ⬇️
... and 6 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

currentScenario = self.get_scenario(scenario)
currentScenario.actors_for_layer('default')[newActor.sName] = newActor
newActor.vPos = [float(c) + offset for c, offset in zip(coords, offset)]
newActor.vPos = [float(c) + offset for c, offset in zip(coords, offset, strict=True)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we already changing it and if we want to keep snake_case: Should be new_actor and current_scenario.

cosmetic_options: dict = configuration["cosmetic_patches"]["lua"]["custom_init"]
inventory: dict[str, int] = configuration["starting_items"]
inventory: ConfigurationStartingItems = configuration["starting_items"]
starting_location: dict = configuration["starting_location"]
starting_text: list[list[str]] = configuration.get("starting_text", [])
configuration_identifier: str = configuration["configuration_identifier"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general: What's the idea of removing the type hints in most methods for the variables? In this part they are kept.

It makes reviewing stuff definetly harder as I need to know what is the type of certain fields of a parameter to follow the code.
...or I completly ignore it while reviewing and rely on mypy annotations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes I just removed because the type can be inferred automatically from the argument. Sometimes I just fixed it. I wasn't exactly consistent.

It's the classic thing of poluting the codebase with typing that can be inferred to make it easier when reading code in a bad ui

@@ -75,8 +79,13 @@ def create_custom_init(editor: PatcherEditor, configuration: dict) -> str:
"ITEM_METROID_TOTAL_COUNT": 40,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment about me wondering if this is really required for Dread.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the game got really mad if some items were missing in this dict so I just kept all keys vanilla does.

"""
Patches a door given a reference.

@param door: A dictionary representing a requested door patch.
@param door_ref: A dictionary representing a requested door patch.
@param door_type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a description to the parameter otherwise the docstring looks like only half done.

Copy link
Member Author

@henriquegemignani henriquegemignani Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fix the docstring's broken link and you go and ask for me to fix the docstring >:(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants