-
Notifications
You must be signed in to change notification settings - Fork 28
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
Suspect formatting bug with Type Hierarchy #115
Comments
Hi @fenjenahwe, I tried to install the library in a fresh virtual environment (Python 3.10.12). I installed The above code gave me the expected outcome, follows a screenshot: Please, @fenjenahwe, can you provide more details on your environment (i.e., operating system, Python version, |
Also, the result can be parsed correctly: from pathlib import Path
from pddl.core import Domain, Requirements
from pddl.formatter import domain_to_string
from pddl import parse_domain
requirements = [Requirements.STRIPS, Requirements.TYPING, Requirements.NEG_PRECONDITION]
types = {
"A": "B",
"B": "C",
"C": None
}
domain = Domain("example",
requirements=requirements,
types=types
)
# write domain to file
Path("example.pddl").write_text(domain_to_string(domain))
# parse the domaion
actual_domain = parse_domain(Path("example.pddl"))
print(domain_to_string(actual_domain))
print("Original domain types:")
print(types)
print("Parsed domain types:")
print(actual_domain.types) The output of the above code snippet is:
|
Thanks @marcofavorito My environment details are: While reinstalling the library in a new environment, I noticed I had been installing pddl version 0.2.0 |
Perfect, thank you so much! If you don't mind, please let us know when you tried so we can be sure it is not an issue. |
I confirm! This solved it. |
Perfect! No worries :) |
Subject of the issue
This issue has been created to investigate more on several issue the user @fenjenahwe is experiencing with the library. Some of the issues the user encountered have been reported in the comments of issue #98, and they are about the formatting of domains with a non-flat hierarchy of types.
The user reported in this comment that the following code:
Prints:
Whereas the expected behaviour is something like:
The text was updated successfully, but these errors were encountered: