Replies: 2 comments
-
You're right about 1. I'm not sure about 2 - will need to look into the detail of the code. About 3, a lot of MUSE (the whole of it?) was designed in such a way that users will want and be able to expand its functionality (?). This includes creating new types of agents doing stuff differently and accepting different inputs. As far as I know, this has never happened, but the functionality is still there. I would not remove the |
Beta Was this translation helpful? Give feedback.
-
Okey doke. I'll do that |
Beta Was this translation helpful? Give feedback.
-
I've been looking at the
Agent
class for reasons and noticed that it takeskwargs
as an input to__init__()
, but only uses this to check if it has a"spend_limit"
element:This
if
-statement is broken.kwargs
will never beNone
; if the user doesn't pass any extra arguments it'll be an empty dict instead. It's also not obvious what the intent with it was, because surely you always want to have a default value forspend_limit
regardless?...which brings me onto my second concern.
spend_limit
appears to be being used without checking whether or not it has this sentinel value of 0 (this should probably beNone
), in which case presumably all non-free technologies will be excluded as being above the limit. I found one place where it is used (infilters.py
: https://github.com/EnergySystemsModellingLab/MUSE_OS/blob/develop/src/muse/filters.py#L357). I'm guessing that either this functionality is never used or is broken? It's entirely possible that I've misunderstood the code though....I figured we could probably drop the
kwargs
and just addspend_limit
as an input argument. The problem is that if we do that, then we get a bunch of test failures for tests which seemingly rely on this behaviour of accepting arbitrary keyword args (in particular they seem to often pass atechnologies
argument; there may be others)... but why?! Optimistically we could just remove these unnecessary arguments and it'll just work.Thougts @dalonsoa @tsmbland ?
Beta Was this translation helpful? Give feedback.
All reactions