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

ENH: don't hide constraints or optional arguments in *args/**kwargs/*constraints etc #466

Open
bsipocz opened this issue Jul 26, 2023 · 2 comments

Comments

@bsipocz
Copy link
Member

bsipocz commented Jul 26, 2023

While their usage seems convenient at first, at the end of the day there are a lot of issues with hiding the details rather then be explicit in an API signature. Just a few of the issues:

@msdemlei
Copy link
Contributor

Hm – I think I understand your rationale, although I have to say I still like the idea that people can just inherit from Constraint and roll their own sorts of constraints for regtap.py. On the other hand, I think I am resigned into the realisation that the keywords won't disappear as legacy.

Be that as it may: What concrete steps do you have in mind? Scrap the _author thing in rtcons Constraints and make these somehow explicit in regtap.search and regtap.get_RegTAP_query? I have to admit that having to repeat that long list of keyword arguments makes me immediately unhappy...

And as to *constraints... Hm. What would you do instead? The interface rather plainly is "pass in zero or more Constraint objects", and I don't there's not much of a good alternative to that. Of course, we could go all-keyword, but for one the keywords are less expressive, and for a second they won't let me pass in two constraints of the same kind (unless I started to accept both sequences and atoms throughout; again, that feels like a recipe for unhappyness), which seems a bit restrictive to me.

@bsipocz
Copy link
Member Author

bsipocz commented Oct 11, 2023

This came up again, #490 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants