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

Incorrect sorting of distances in CAP weight file with weights_dist option #144

Closed
thurinj opened this issue May 16, 2024 · 3 comments
Closed

Comments

@thurinj
Copy link
Contributor

thurinj commented May 16, 2024

Hi @bch0w ,

Here's a quick unintended behavior I found using the weights_dist option to write the CAP file from pysep:
image

It seems that it is using string-based sorting and it messes up with the ordering when moving from 10~ to 100~ and 100~ to 1000~ (distance is the second column, in km).

@bch0w
Copy link
Member

bch0w commented May 16, 2024

Thanks for catching that @thurinj, I imagine it's coming from here

https://github.com/adjtomo/pysep/blob/master/pysep/utils/cap_sac.py#L100-L102

Might just need a float conversion before sorting. I'll try to get to that asap

bch0w added a commit that referenced this issue May 16, 2024
* removed pypi version documentation, moved to adjdocs
bump patch version number
remove annoying warning log when specfem source does not have origin time

* added docstring for recsec taper parameter

* fixed sorting issue related to #144 and extended test to cover this function

* update changelog
@bch0w
Copy link
Member

bch0w commented May 16, 2024

Hopefully I didn't jump the gun by doing the full version release but I think I fixed this in #145, let me know if that looks good on your end!

@thurinj
Copy link
Contributor Author

thurinj commented May 16, 2024

Looks all good to me, thanks for the lightning-fast fix ⚡!

@thurinj thurinj closed this as completed May 16, 2024
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

No branches or pull requests

2 participants