pyiron / pyiron/executorlib

[Bug] Caching is not unique for classes with call function

Open
#868 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
77
Forks
7
Avg merge
10h 32m
Merged PRs (30d)
12

Description

For example

class Test:
    def __call__(self, a, b):
        return a+b

While the class definition is unique the instance Test() is not this results in a different hash and consequently the calculation is repeated rather than reloaded. So at the moment it is not recommended to use dynamically defined objects in combination with the caching feature.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue's Test class with call and the caching feature, then trace how callable classes and their instances are represented for cache keys. Check whether repeated use of the same dynamically defined callable reuses the cached calculation, and document or test the observed behavior before changing it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.