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

Remove pickling when saving FunctionalCorrector #25

Open
jmbhughes opened this issue Apr 6, 2023 · 1 comment
Open

Remove pickling when saving FunctionalCorrector #25

jmbhughes opened this issue Apr 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jmbhughes
Copy link
Member

Pickles are inherently unsafe and can have portability issues. We should use a different format. I'm unsure what is a better alternative off-hand.

def save(self, path: str) -> None:
with open(path, "wb") as f:
dill.dump(self, f)
@classmethod
def load(cls, path: str) -> FunctionalCorrector:
with open(path, "rb") as f:
return dill.load(f)

@jmbhughes
Copy link
Member Author

In addition, they make ruff fail in our internal CI linting step.

@jmbhughes jmbhughes self-assigned this Jun 7, 2023
@jmbhughes jmbhughes added the bug Something isn't working label Jun 7, 2023
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