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

Refactor views.py to use classmethod for parsing XML elements #268

Merged
merged 2 commits into from
Nov 11, 2023

Conversation

cleder
Copy link
Owner

@cleder cleder commented Nov 11, 2023

No description provided.

WatermelonAI Summary

This PR refactors the views.py file to use a classmethod for parsing XML elements. This change improves the efficiency and readability of the code, enhancing the overall performance and maintainability of the application.

GitHub PRs

Click here to login to Jira
Click here to login to Confluence
Click here to login to Slack
Click here to login to Notion
Click here to login to Linear
Click here to login to Asana
fastkml is an open repo and Watermelon will serve it for free.
🍉🫶

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

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

Comparison is base (58041e9) 92.83% compared to head (178ae5d) 92.63%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #268      +/-   ##
===========================================
- Coverage    92.83%   92.63%   -0.21%     
===========================================
  Files           34       34              
  Lines         4812     4817       +5     
===========================================
- Hits          4467     4462       -5     
- Misses         345      355      +10     
Files Coverage Δ
tests/views_test.py 100.00% <100.00%> (ø)
fastkml/views.py 86.63% <97.77%> (-4.65%) ⬇️

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

Copy link

what-the-diff bot commented Nov 11, 2023

PR Summary

  • Introduction of new 'typing' tool
    An import statement for 'typing.Any' was added to a file fastkml/views.py. This means the code is now better prepared to handle a variety of data types, increasing flexibility and robustness.

  • Addition of the helper function _get_kwargs
    A new class method _get_kwargs was added to Camera, LookAt, and Orbit classes. This function provides an efficient way to gather the keyword arguments (input parameters) for these classes, enabling more streamlined and organized processes.

  • Removal of from_element method
    The from_element method was removed from the Camera and LookAt classes. This implies some reorganization of how elements are handled within these classes, likely for improved efficiency and clarity.

  • Replacement of from_string method
    Instead of the previous from_string method in Camera and LookAt classes, we now have a class_from_string method. This increases clarity as it directly implies that the method produces a class instance from a string, probably improving the coding process.

  • Code Refactoring in fastkml/views.py
    The existing code in Camera, LookAt, and Orbit classes was improved by using super()._get_kwargs(). The 'super' keyword here refers to classes that are ancestors to these classes - this refactoring helps reduce repetition, keeping the code DRY (Don't Repeat Yourself), a key principle in software development.

@ghost
Copy link

ghost commented Nov 11, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

WatermelonAI Summary

This Pull Request refactors the views.py file to use a classmethod for parsing XML elements. It also merges the changes from the develop branch into the 261-refactor-_abstractview-camera-and-lookat branch. This update improves the way XML elements are handled in the codebase.

GitHub PRs

Click here to login to Jira
Click here to login to Confluence
Click here to login to Slack
Click here to login to Notion
Click here to login to Linear
Click here to login to Asana
fastkml is an open repo and Watermelon will serve it for free.
🍉🫶

@cleder cleder merged commit e065244 into develop Nov 11, 2023
45 of 48 checks passed
@cleder cleder deleted the 261-refactor-_abstractview-camera-and-lookat branch November 11, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor _AbstractView, Camera And LookAt
1 participant