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

Env-scoped lru cache. #104

Open
chenkins opened this issue Dec 20, 2024 · 0 comments
Open

Env-scoped lru cache. #104

chenkins opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@chenkins
Copy link
Contributor

Description
LRU cache is global, and not local to a RailEnv. Cache is reset in multiple places by calling send_infrastructure_data_change_signal_to_reset_lru_cache(). However, some cached function calls use @lru_cache directly - these cached calls are not reset by send_infrastructure_data_change_signal_to_reset_lru_cache(), although some of these functions cache env-specific data.

Two steps:

  1. send_infrastructure_data_change_signal_to_reset_lru_cache() must reset all LRU caches (or at least all LRU caches with env-specific data).
  2. major refactoring to make LRU caching local to a RailEnv and (if possible) reduce the number of locations where cache reset is called.

Relates to #92 .

To Reproduce
List the steps needed to reproduce the behavior:

  1. '...'
  2. '...'

Expected behavior
Describe what you expected to happen in a clear and concise manner.

Information
Describe the machine and software you are using:

  • OS: [e.g. Mac]
  • Python version [e.g. 3.8]
  • Package version [e.g. 3.0.15]

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant