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

fix #53 by importing Exchange from bw2data.backends #54

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

muelleram
Copy link
Contributor

No description provided.

@muelleram
Copy link
Contributor Author

#53

@tngTUDOR
Copy link
Contributor

tngTUDOR commented Jun 11, 2024

I'm not sure if using "Exchange" in fact was intended here, or if isis the best solution. This requires adding one more class to the module's dependencies.

things suggesting [to me] against using Exchange:

  • The function's suggested return type is ExchangeDataset and not Exchange.
  • the iterator is supposed to provide a list of EchangeDataset.
  • ExchangeDataset class members input_code and output_code are tuples strings, and lack the "database" part of a full Exchange input tuple (which is less informational when printed in a the exception.
  • the new dependency does come from a package already imported (not the schemas module, but the proxies)

the opposite

  • The raise statement uses Exchange class member names (input and output)
  • Exchange class members input and output are tuples like: ('database', 'code'). These are nicer to see "printed" in the error message

@tngTUDOR
Copy link
Contributor

I'm not sure if using "Exchange" in fact was intended here, or if isis the best solution. This requires adding one more class to the module's dependencies.

things suggesting [to me] against using Exchange:

  • The function's suggested return type is ExchangeDataset and not Exchange.
  • the iterator is supposed to provide a list of EchangeDataset.
  • ExchangeDataset class members input_code and output_code are tuples strings, and lack the "database" part of a full Exchange input tuple (which is less informational when printed in a the exception.
  • the new dependency does come from a package already imported (not the schemas module, but the proxies)

the opposite

  • The raise statement uses Exchange class member names (input and output)
  • Exchange class members input and output are tuples like: ('database', 'code'). These are nicer to see "printed" in the error message

I think, Adding Exchange does not bring additional burden in terms of deps, and it helps dev work.

tngTUDOR added 3 commits June 11, 2024 14:10
Update the version for publication
Update the version for publication
@tngTUDOR
Copy link
Contributor

@muelleram I think the way the pull request looks now, it could be merged.
However, it would be good to have a "test" to make sure that the "MultipleEdges" condition is tested. Do you think you can add this to the PR ?

@muelleram
Copy link
Contributor Author

@tngTUDOR, thanks, yes, I can write a test for that.

@muelleram
Copy link
Contributor Author

@tngTUDOR, I added a test. Please check and feel free to merge if you think the PR looks good now.

@tngTUDOR tngTUDOR linked an issue Jun 18, 2024 that may be closed by this pull request
@tngTUDOR tngTUDOR closed this Jun 18, 2024
@tngTUDOR tngTUDOR reopened this Jun 18, 2024
Copy link
Contributor

@tngTUDOR tngTUDOR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test added along the fix.

@tngTUDOR tngTUDOR merged commit 9f5c823 into brightway-lca:main Jun 18, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

NameError: name Exchange is not defined in lca.py
2 participants