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

Replace rstrip() with removesuffix() in triggers text #411

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

iaraota
Copy link
Collaborator

@iaraota iaraota commented Jul 5, 2024

This PR replaces rstrip('.0') with removesuffix('.00') to avoid removing any 0 before . in the string. See the examples below:

>>> a = "10.00" 
>>> b = "11.00" 
>>> c = "110.00"
>>> a.rstrip('.0')
'1'
>>> a.removesuffix('.00')
'10'
>>> b.rstrip('.0')
'11'
>>> b.removesuffix('.00')
'11'
>>> c.rstrip('.0')
'11'
>>> c.removesuffix('.00')
'110'

@iaraota iaraota added the bug-fix label Jul 5, 2024
@iaraota iaraota requested a review from eagoetz July 5, 2024 15:41
@iaraota iaraota self-assigned this Jul 5, 2024
@iaraota
Copy link
Collaborator Author

iaraota commented Jul 5, 2024

@eagoetz this PR fixes the bug reported in: https://git.ligo.org/detchar/ligo-summary-pages/-/issues/246

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 49.27%. Comparing base (720bd0c) to head (6b7410d).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
gwsumm/plot/triggers/core.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #411      +/-   ##
==========================================
- Coverage   49.64%   49.27%   -0.38%     
==========================================
  Files          60       60              
  Lines        8823     8789      -34     
==========================================
- Hits         4380     4330      -50     
- Misses       4443     4459      +16     
Flag Coverage Δ
Linux 49.27% <0.00%> (-0.38%) ⬇️
macOS 49.27% <0.00%> (?)
python3.10 49.27% <0.00%> (-0.38%) ⬇️
python3.11 49.27% <0.00%> (-0.38%) ⬇️
python3.9 49.27% <0.00%> (-0.37%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Collaborator

@eagoetz eagoetz left a comment

Choose a reason for hiding this comment

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

LGTM

@iaraota
Copy link
Collaborator Author

iaraota commented Jul 5, 2024

@eagoetz The failing tests are installing the version 1.14.0 of scipy and the ones that passed installed version 1.13.1. I saw that Duncan removed the deprecated trapz function from gwpy, but it was not released yet. I am not sure how to make the tests use an old scipy version. Should we force it in the pyproject.toml?

@eagoetz
Copy link
Collaborator

eagoetz commented Jul 5, 2024

@eagoetz The failing tests are installing the version 1.14.0 of scipy and the ones that passed installed version 1.13.1. I saw that Duncan removed the deprecated trapz function from gwpy, but it was not released yet. I am not sure how to make the tests use an old scipy version. Should we force it in the pyproject.toml?

I think we may have to in the short term. Can you try restricting to <1.14 in this PR?

…ould be changed once gwpy new release remove the deprecation.
@iaraota
Copy link
Collaborator Author

iaraota commented Jul 5, 2024

@eagoetz The failing tests are installing the version 1.14.0 of scipy and the ones that passed installed version 1.13.1. I saw that Duncan removed the deprecated trapz function from gwpy, but it was not released yet. I am not sure how to make the tests use an old scipy version. Should we force it in the pyproject.toml?

I think we may have to in the short term. Can you try restricting to <1.14 in this PR?

Thank you, Evan! I also restricted the gwpy version to the latest. Once the new version is released we should change both.

Copy link
Collaborator

@eagoetz eagoetz left a comment

Choose a reason for hiding this comment

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

LGTM

@eagoetz eagoetz added this to the 2.2.7 milestone Jul 5, 2024
@eagoetz eagoetz merged commit e354f4c into gwpy:master Jul 22, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants