-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: ObjectAPI to ValueAPI: Foresight Additions #2819
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
Python: ObjectAPI to ValueAPI: Foresight Additions #2819
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this is a great addition, it's kind of annoying having to go in and cherry pick these off one-by-one.
Would also be great if you could follow the naming convention. For example, listType
should just be list
. Like it is on master), so I guess something tricky happened when you rebased against master.
I have a few suggestions, but otherwise it looks good 👍
I would like to propose actually that we move everything over to the |
Co-Authored-By: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
Co-Authored-By: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
I think for the moment, it's best to stick with the scheme we have. As you point out, if we were to change the API, we would have to deprecate the old predicates, wait a while, and then finally remove them. Also, I wonder if it would be more confusing to have all of these methods end in We should probably clean up in these predicates at some point in the future. I note, for instance, that at present it's |
I've swapped out the names, such that the predicate name is whats in the string-y name. Some of the pre-existing things are not consistent with this pattern tho, so we might want to push to that convention instead? I've also had to add _ to some of them to avoid conflicts w/ QL naming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to me it looks good now! 👍
I didn't find any usage of ClassValue::function()
, so from my point of view we should go ahead with your renaming that follows the conventions 💯 but let's see if @tausbn has a strong opinion about this
I think my opinion on naming can be summed up as "as close to what you would get in Python as possible, lowercase the first letter if necessary, and add a Some of these I'm not sure we need at all, though, or will ever need, for that matter. As far as I can see, (Note that some of them are used elsewhere, like the Perhaps what we really need is a different interface for this. It seems to be that just piggy-backing onto the (I note in passing that there may be a bug in how we calculate the result of |
This PR is part of the effort to modernize the Expressions queries, moving away from the use of
refersTo
and associated APIs, and towardspointsTo
and its associated APIs.Foresight Additions
There are some additions that are in-progress for foresight purposes. The old
refersTo
code makes extensive use of predicates liketheIntType()
which modernizes toClassValue::int_()
. Not all of thethe...Type()
predicates have been translated, presumably because they're being moved over on an as-needed basis. It seems useful to just move everything over since most of it is formulaic.