DASDAE / dascore

A python library for distributed fiber optic sensing
Other
71 stars 16 forks source link

add `change_length` coord method #363

Closed d-chambers closed 4 months ago

d-chambers commented 4 months ago

Description

This PR adds a method to CoordRange called change_length to allow easy modifications to the length of evenly sampled coordinates. It was primarily added to mitigate off by one errors related to float coordinates, but may be useful for other things to.

It looks like this:

new_coord = coord.change_length(length=10)  # change length to 10 by adjusting end values.

Checklist

I have (if applicable):

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.55%. Comparing base (4330787) to head (3fe3e78).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #363 +/- ## ========================================== + Coverage 98.85% 99.55% +0.70% ========================================== Files 94 94 Lines 7392 7400 +8 ========================================== + Hits 7307 7367 +60 + Misses 85 33 -52 ``` | [Flag](https://app.codecov.io/gh/DASDAE/dascore/pull/363/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DASDAE) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/DASDAE/dascore/pull/363/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DASDAE) | `99.55% <100.00%> (+0.70%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DASDAE#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.