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

Faulty implementation of blinker's signal.send() #220

Open
mrvisscher opened this issue Dec 19, 2024 · 0 comments
Open

Faulty implementation of blinker's signal.send() #220

mrvisscher opened this issue Dec 19, 2024 · 0 comments

Comments

@mrvisscher
Copy link

mrvisscher commented Dec 19, 2024

According to blinker's documentation the .send method expects the first argument to be the sender object. bw2data's implementation is inconsistent with the documentation and within itself.

For example in signals.py, the sender argument is omitted, meaning it will be set as None. This makes using the sender argument in blinker's .connect method impossible.

if signal:
signaleddataset_on_save.send(
old=old,
new=self,
)

In project.py the project dataset is passed through the sender arg, which is of course not how it should be used. This again breaks blinkers .connect method and is inconsistent with the earlier example.

project_changed.send(self.dataset)

Blinkers documentation for reference: https://blinker.readthedocs.io/en/stable/#blinker.Signal.send

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

No branches or pull requests

1 participant