Code Monkey home page Code Monkey logo

Comments (1)

yalinli2 avatar yalinli2 commented on June 17, 2024

OK I figured this out. Firstly to give some context, the question was actually about even with this line:

F_BM = {'Battery System': 1, 'Solar Cost':1}

There'll still be an error like:

/Users/yalinli_cabbi/OneDrive/Coding/bst/biosteam/_unit.py:629: RuntimeWarning: the purchase cost item, 'Battery System', has no defined bare-module factor in the 'SolarReclaimer.F_BM' dictionary; bare-module factor now has a default value of 1
warn(warning)
/Users/yalinli_cabbi/OneDrive/Coding/bst/biosteam/_unit.py:629: RuntimeWarning: the purchase cost item, 'Solar Cost', has no defined bare-module factor in the 'SolarReclaimer.F_BM' dictionary; bare-module factor now has a default value of 1
warn(warning)

This was because that in biosteam, _init_results (would be called by __init__), will do this:

    def _init_results(self):
        try:
            #: [dict] All bare-module factors for each purchase cost.
            #: Defaults to values in the class attribute `_F_BM_default`.
            self.F_BM = self._F_BM_default.copy()
        except AttributeError:
            self.F_BM = {}

which overwrite the F_BM

So, the correct way (if you wish to set all F_BM to a certain number) is to use the F_M_default attribute, which is what you are doing now:

SanUnit.__init__(self, ID, ins, outs, F_BM_default=1)

So, you can remove the following two lines (because now you have that line 50):

F_BM = {'Battery System': 1, 'Solar Cost':1}

# self._BM = dict.fromkeys(self.baseline_purchase_costs.keys(), 1)

from qsdsan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.