Giter Site home page Giter Site logo

Comments (1)

Paul-Robineau avatar Paul-Robineau commented on July 29, 2024

Some update:

By looking at the code, it seems like the init of the ExcelLCIAImporter class in the excel_lcia.py prevents or cancels the init of the LCIAImporter class in the base_lcia.py.

The LCIAImporter class init in base_lcia.py:

class LCIAImporter(ImportBase):
    def __init__(self, filepath, biosphere=None):
        print("init yup")
        self.applied_strategies = []
        self.filepath = filepath
        self.biosphere_name = biosphere or config.biosphere
        if self.biosphere_name not in databases:
            raise ValueError(
                "Can't find biosphere database {}".format(self.biosphere_name)
            )
        self.strategies = [

# [...] the code continues

The excel_lcia.py import the LCIAImporter class, so biosphere_name should be ok, but then we have the ExcelLCIAImporter class init :

class ExcelLCIAImporter(LCIAImporter):

# [...] Some code commmentaries

    format = "Excel"
    extractor = ExcelExtractor

    def __init__(self, filepath, name, description, unit, **metadata):
        assert isinstance(name, tuple)
        super(ExcelLCIAImporter, self).__init__(filepath, biosphere=None)
        self.strategies = [

# [...] the code continues

The line super(ExcelLCIAImporter, self).__init__(filepath, biosphere=None) was added on our side after looking at the structure of the init of the SimaProLCIACSVImporter class, which contains an analog line, which gave the idea. When it's added, the AttributeError on biosphere_name of the ExcelLCIAImporter disappears.

Not sure if it's the proper way to fix the issue, but hope it helps!

from brightway2-io.

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.