AI-Planning / pddl

Unquestionable PDDL 3.1 parser
https://ai-planning.github.io/pddl/
MIT License
85 stars 27 forks source link

Make pickling to work on domains/problems objects (Fix #79) #80

Closed marcofavorito closed 1 year ago

marcofavorito commented 1 year ago

Proposed changes

Fixes a bug in the wrapper _getstate of the __getstate__ method (262b347f95586a361f1da23e89381dd83aa3191a), since the cached hash value __hash was not set if the hash was never computed on an object; and in that case, the pop from the dict-state was not available.

This PR also add tests that make sure the pickling works.

Fixes

Fix #79.

Types of changes

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

Checklist

Put an x in the boxes that apply.

Further comments

n/a

codecov-commenter commented 1 year ago

Codecov Report

Merging #80 (db9b14d) into main (e9669dd) will increase coverage by 0.01%. The diff coverage is 100.00%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #80      +/-   ##
==========================================
+ Coverage   89.66%   89.67%   +0.01%     
==========================================
  Files          22       22              
  Lines        1180     1182       +2     
  Branches      192      193       +1     
==========================================
+ Hits         1058     1060       +2     
  Misses         92       92              
  Partials       30       30              
Flag Coverage Δ
unittests 89.67% <100.00%> (+0.01%) :arrow_up:

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

Impacted Files Coverage Δ
pddl/helpers/cache_hash.py 94.59% <100.00%> (+0.30%) :arrow_up: