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

✨ [FEAT] Add CirkwiParser to retrieve Treks and Touristic Contents (refs #3947) #3968

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

Chatewgne
Copy link
Contributor

@Chatewgne Chatewgne commented Feb 29, 2024

Description

Related Issue

#3947

Checklist

  • I have followed the guidelines in our Contributing document
  • My code respects the Definition of done available in the Development section of the documentation
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes
  • I added an entry in the changelog file
  • My commits are all using prefix convention (emoji + tag name) and references associated issues
  • I added a label to the PR corresponding to the perimeter of my contribution
  • The title of my PR mentionned the issue associated

@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 2 times, most recently from 2f125da to 5173b63 Compare February 29, 2024 16:32
@Chatewgne Chatewgne changed the title ✨ [FEAT] Add to retrieve Treks and Touristic Contents (refs #3947) ✨ [FEAT] Add CirkwiParser to retrieve Treks and Touristic Contents (refs #3947) Feb 29, 2024
Copy link

cypress bot commented Feb 29, 2024

Geotrek-admin    Run #10507

Run Properties:  status check passed Passed #10507  •  git commit 70171ce990 ℹ️: Merge 5381f1e6f8c5cc3634fc4869d6155898bf63b6cb into 0fec8084eea1f82c694ac178e3cc...
Project Geotrek-admin
Branch Review refs/pull/3968/merge
Run status status check passed Passed #10507
Run duration 02m 09s
Commit git commit 70171ce990 ℹ️: Merge 5381f1e6f8c5cc3634fc4869d6155898bf63b6cb into 0fec8084eea1f82c694ac178e3cc...
Committer Célia
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 22
View all changes introduced in this branch ↗︎

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.46%. Comparing base (0fec808) to head (5381f1e).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3968      +/-   ##
==========================================
+ Coverage   98.45%   98.46%   +0.01%     
==========================================
  Files         267      268       +1     
  Lines       21106    21290     +184     
==========================================
+ Hits        20780    20964     +184     
  Misses        326      326              

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

@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 10 times, most recently from 6add793 to 809dfb9 Compare March 4, 2024 16:55
@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 13 times, most recently from b5bc7e8 to 2431963 Compare November 20, 2024 12:08
@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 2 times, most recently from 180ca07 to 8e94844 Compare November 20, 2024 12:56
@Chatewgne Chatewgne marked this pull request as ready for review November 20, 2024 12:56
geotrek/cirkwi/parsers.py Outdated Show resolved Hide resolved
@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 5 times, most recently from 4be8290 to 44c8c58 Compare November 22, 2024 12:26
@Chatewgne Chatewgne requested a review from a team November 22, 2024 14:25
Copy link
Contributor

@marcantoinedupre marcantoinedupre left a comment

Choose a reason for hiding this comment

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

I have reviewed the move of the get_geom* functions and I have added a comment. :)

geotrek/trekking/parsers.py Outdated Show resolved Hide resolved
@Chatewgne Chatewgne force-pushed the feat_cirkwi_parser branch 2 times, most recently from 8035303 to 1c70e0f Compare November 25, 2024 09:32
@Chatewgne Chatewgne requested review from marcantoinedupre and a team November 25, 2024 09:33
Copy link
Contributor

@marcantoinedupre marcantoinedupre left a comment

Choose a reason for hiding this comment

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

I have made a few remarks you may address.

LGTM otherwise. Nice work! 👍

src = src.replace("<LANG>", self.default_language)
# Return a list of XML elements
if src.endswith('/*'):
return val.findall(src[:-2])
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is possible to return directly strings here instead of a list of XML elements. This way it would work in the same way than when a single text value is returned at line 114. And you could remove all conversion done in filter_* methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It gets tricky with lists here, because, what do we do after retrieving the multiple elements ? Do we need to get the list of inner texts, or a list from the attributes ? Are we looking for one or several other inner element(s) ? We would need to add some more recursivity to combine this with the other syntaxes. It's why I chose to use get_part to return the list of elements and let filter_xxxx handle further processing for now

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, let's leave it as is then.

geotrek/cirkwi/parsers.py Show resolved Hide resolved
@Chatewgne Chatewgne merged commit 7c79290 into master Dec 4, 2024
21 checks passed
@Chatewgne Chatewgne deleted the feat_cirkwi_parser branch December 4, 2024 07:16
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.

2 participants