Skip to content

IO Balance function#125

Open
MohamedhBadr wants to merge 7 commits into
IndEcol:masterfrom
MohamedhBadr:master
Open

IO Balance function#125
MohamedhBadr wants to merge 7 commits into
IndEcol:masterfrom
MohamedhBadr:master

Conversation

@MohamedhBadr

Copy link
Copy Markdown

A function that checks the MRIO balance by:

1- Making sure that the matrix dimensions are compatible
2- Checks if total inputs = total outputs
3- Checks sector/product balance (sector/product inputs = sector/product outputs)

Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated

@konstantinstadler konstantinstadler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some comment in the iobalance.py
please also remove all .history files

Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated
Comment thread pymrio/tools/iobalance.py Outdated
@MohamedhBadr

Copy link
Copy Markdown
Author

Added new commits, fixed issues with the IO balance function.

@konstantinstadler

Copy link
Copy Markdown
Member
  • change exception to ValueError as much as possible
  • move to io_math
  • signature: def is_balanced(Z, Y, VA, ... , a_tol, r_tol (as in numpy), report=False)
  • report, if False, just return True/False, if report == True, return df

report df (think about return type, perhaps dict?)
checked_parameter, balanced
Z-VA = Z-FD, true/false

once this is done, go to mrio_system - IOSystem and add
def is_balanced(self, VA, a_tol, r_tol, report) (all except the one available in self)
io_math.is_balanced(Z=self.Z, VA=VA, ...)

write pytest function as well

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.

2 participants