-
Notifications
You must be signed in to change notification settings - Fork 60
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
Expose submodules and add type annotations #67
Conversation
Type annotations
More type annotations
Converted to a draft while I test the new commit. |
Converted tests to UnitTest
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.
Thanks so much for doing this. Looks broadly good but I want to take a closer look before merging and @ronuchit may too. To make it a little easier to review, would you mind splitting this into at least three PRs:
- exposing the submodules
- changing the tests to unittests
- adding type annotations
@@ -0,0 +1,11 @@ | |||
# import os |
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.
remove this file or uncomment?
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.
Oops, will remove 😅
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.
Thanks so much for doing this. Looks broadly good but I want to take a closer look before merging and @ronuchit may too. To make it a little easier to review, would you mind splitting this into at least three PRs:
- exposing the submodules
- changing the tests to unittests
- adding type annotations
Sure! I'll link those here once they exist and ping you.
Unittests: #68
Expose submodules: #69
Type annotations: #70
@@ -99,6 +99,7 @@ def _create_preconds_pddl_str(self, preconds): | |||
class PDDLParser: | |||
"""PDDL parsing class. | |||
""" | |||
predicates: Dict[str, Predicate] |
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.
what's up with this?
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.
I misread predicates
as being set in one of PDDLParser
's methods, I think, and just set the type def at the top of the class def.
Looking back at the code, predicates
is actually set separately in PDDLProblemParser
and PDDLDomainParser
.
We could
- set the type hint in the parent
PDDLParser
class for both of them - Set it separately in each
- For
PDDLDomainParser
,predicates
is set in_parse_domain_predicates
, rather than the init itself. We could either set the type hint in_parse_domain_predicates
, or the top of the class, like I did here (but forPDDLDomainParser
.
- For
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.
But we can handle that in the split out PR.
Sure! I'll link those here once they exist and ping you. |
Description
Make the
core
,structs
, andspaces
modules available for import. This allows importing libraries to use the contained classes for type annotations.Add some (not all) type annotations.
Tests
Ran each test file in
pddlgym/tests
. They all passed.