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

Support setting query_qualities using a string #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nh13
Copy link
Contributor

@nh13 nh13 commented Jan 13, 2025

No description provided.

@jmarshall
Copy link
Member

jmarshall commented Feb 5, 2025

I rather like this, although I am slightly in two minds whether it wants a separate entry point or overloading the parameter type is a good idea — the latter, as done here, will need to complicate the type hints a bit.

Amusingly this is already possible via the deprecated qual property…

@nh13
Copy link
Contributor Author

nh13 commented Feb 5, 2025

@jmarshall thanks for considering this, I'll let you know decide how you'd like to precede

edit: was multi-tasking, sorry for the edit, I defer to you

@nh13
Copy link
Contributor Author

nh13 commented Mar 7, 2025

@jmarshall let me know what you think, we could use the overload decorator in typing too?

@jmarshall
Copy link
Member

I'm working on extending this a little. My main concern is that having set it via a string, there's no (non-deprecated) way to get a string back out again — reading rec.query_qualities will return it as an array.

So I'm drafting adding another query_qualities_str property that would get/set this as a string. And query_qualities as per your PR would accept setting from either an array or a string, but return only an array as at present. Possibly also a query_qualities_array as well for explicitness, but that one's a bit over the top.

There's also a bunch of small bugs in this area which I'm squashing… 😞

@nh13
Copy link
Contributor Author

nh13 commented Mar 14, 2025

Thanks @jmarshall! It would be nice not to have to use qualitystring_to_array, array_to_qualitystring, and qualities_to_qualitystring anymore.

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