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

Return type annotation for Problem and Domain transformers. Fixed requirements type annotation in DomainTransformer. #102

Merged
merged 5 commits into from
Dec 31, 2023

Conversation

MichaelJFishman
Copy link
Contributor

Proposed changes

A few type annotations. I didn't add any annotations to parse_problem and parse_domain, because I didn't want to Domain and Problem imports to the __init__.py.

Fixes

Adds return type annotation for Problem and Domain transformers, by specifying that type parameter when subclassing Transformer. Also annotated that Domain.__call__ and Problem.__call__ return Domain and Problem, respectively.

Fixed _requirements type annotation in DomainTransformer.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works

I ran the tests and got the following output. I can't tell from this where mypy/evaluation failed.

========================================================= 2117 passed in 347.71s (0:05:47) =========================================================
.pkg: _exit> python /home/johnny/mambaforge/envs/scoping_new_z3/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
  check-copyright: OK (0.18=setup[0.14]+cmd[0.05] seconds)
  black-check: OK (3.71=setup[2.67]+cmd[1.03] seconds)
  isort-check: OK (1.97=setup[1.73]+cmd[0.24] seconds)
  docs: OK (10.27=setup[9.62]+cmd[0.65] seconds)
  flake8: OK (4.05=setup[3.20]+cmd[0.86] seconds)
  mypy: FAIL code 1 (7.70=setup[5.04]+cmd[2.65] seconds)
  py37: SKIP (0.12 seconds)
  py38: SKIP (0.01 seconds)
  py39: SKIP (0.01 seconds)
  py310: OK (362.15=setup[13.69]+cmd[348.46] seconds)
  evaluation failed :( (390.27 seconds)

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (514d568) 88.10% compared to head (1829d4e) 88.35%.
Report is 4 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
+ Coverage   88.10%   88.35%   +0.24%     
==========================================
  Files          25       25              
  Lines        1791     1794       +3     
  Branches      332      333       +1     
==========================================
+ Hits         1578     1585       +7     
+ Misses        154      149       -5     
- Partials       59       60       +1     
Flag Coverage Δ
unittests 88.35% <100.00%> (+0.24%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pddl/helpers/base.py 97.82% <100.00%> (+0.35%) ⬆️
pddl/parser/domain.py 76.25% <100.00%> (-0.42%) ⬇️
pddl/parser/problem.py 67.66% <100.00%> (+1.72%) ⬆️

@haz
Copy link
Contributor

haz commented Dec 26, 2023

Thanks for the fixes here! You can find more details on the blocking error here: https://github.com/AI-Planning/pddl/actions/runs/7240077134/job/19740335600?pr=102

@marcofavorito
Copy link
Member

marcofavorito commented Dec 31, 2023

Hi @MichaelJFishman, thank you very much for this PR 🙂

I would like to push some commits to this PR. Could you please "Allow edits from maintainers"? (see this link)

@MichaelJFishman
Copy link
Contributor Author

MichaelJFishman commented Dec 31, 2023

Thanks for the commits!

It looks like "Allow edits from maintainers" is already enabled on this PR. Are you still unable to edit it?

image

Edit: @marcofavorito

This commit updates the __call__ method of both DomainParser and ProblemParser classes in such a way that sys.tracebacklimit is not overwritten to 'None' if it has been already set by the caller.
@marcofavorito
Copy link
Member

Thanks for the commits!

It looks like "Allow edits from maintainers" is already enabled on this PR. Are you still unable to edit it?

image

Edit: @marcofavorito

Confirmed, thanks :)

Copy link
Member

@marcofavorito marcofavorito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @MichaelJFishman !

@marcofavorito marcofavorito merged commit 502c7a4 into AI-Planning:main Dec 31, 2023
9 checks passed
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.

5 participants