pymrio icon indicating copy to clipboard operation
pymrio copied to clipboard

IO Balance function

Open MohamedhBadr opened this issue 1 year ago • 2 comments

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)

MohamedhBadr avatar Oct 13 '23 08:10 MohamedhBadr

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

MohamedhBadr avatar Oct 20 '23 08:10 MohamedhBadr

  • 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

konstantinstadler avatar Nov 23 '23 10:11 konstantinstadler