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

importer: Add support for aged z database #36

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

mafredri
Copy link
Contributor

Had trouble importing my z database since my database has been been aged many, many times 😄.

So z uses aging which results in the db containing floats instead of ints:
https://github.com/rupa/z/blob/9d5a3fe0407101e2443499e4b95bca33f7a9a9ca/z.sh#L83-L84

This PR fixes the following error during import (jump import z):

err: strconv.ParseInt: parsing "2.9788732572612733": invalid syntax

I added a todo because I'm unsure what would be good / fair behavior. Rounding the values as-is to integers will give a slight advantage to results with a slightly lesser score (say, 22.2 vs 22.3 because both become 22).

I thought about multiplying with 100 to even it out a bit, but then I don't know what these scores would "mean" in jump.

@gsamokovarov
Copy link
Owner

gsamokovarov commented Mar 19, 2019

Hey, thanks for fixing this!

When you're importing autojump or z scores, the best way would be to start from a clean slate, as the scores between autojump, z or jump are not really comparable. The "base" units weigh differently across the scoring algorithms and there is no need to try to normalize them. As long as the imported values are relative between themselves, all will be good and jump will take over the scoring with time.

So, if you see lot's of scores in your config that are close to each other, maybe boosting them a bit can help, but IMO, the rounding as done now will be just fine. You can remove the TODO and I'll merge it.

@mafredri
Copy link
Contributor Author

No problem, it's a good code base so it was easy enough 😄.

Thanks for clarifying about the weights! I rebased away the todo 👍.

@gsamokovarov gsamokovarov merged commit 27e46a1 into gsamokovarov:master Mar 19, 2019
@gsamokovarov
Copy link
Owner

Thank you! 🙏

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

Successfully merging this pull request may close these issues.

2 participants