Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Spreadsheet' object has no attribute 'Range' #252

Open
rdmolony opened this issue Apr 29, 2020 · 1 comment
Open

AttributeError: 'Spreadsheet' object has no attribute 'Range' #252

rdmolony opened this issue Apr 29, 2020 · 1 comment

Comments

@rdmolony
Copy link

The Issue

I've install the @kmonson forked version of this repo #248 which fixes issues #241 and #240 and unfortunately encountered the following bug when attempting to run example/advanced.py

./examples/advanced.xlsx
___### Cleaning Pointers ###___
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
~/src/koala_vallettea/examples/advanced.py in <module>
     21 ### Graph Generation ###
     22 c = ExcelCompiler(filename, ignore_sheets = ['Sheet2'], ignore_hidden = True, debug = True)
---> 23 c.clean_pointer()
     24 sp = c.gen_graph(inputs= inputs, outputs = outputs)
     25 

~/src/koala_vallettea/koala/ExcelCompiler.py in clean_pointer(self)
     35             PendingDeprecationWarning
     36         )
---> 37         self.spreadsheet.clean_pointer()
     38 
     39     def gen_graph(self, outputs = [], inputs = []):

~/src/koala_vallettea/koala/Spreadsheet.py in clean_pointer(self)
    441             if is_range(reference):
    442                 if 'OFFSET' not in reference:
--> 443                     my_range = self.Range(reference)
    444                     self.cellmap[n] = Cell(n, None, value = my_range, formula = reference, is_range = True, is_named_range = True )
    445                 else:

AttributeError: 'Spreadsheet' object has no attribute 'Range'

I also tried implementing @kmonson suggestions in #241 and #240 myself on the @vallettea master branch to make sure that this issue isn't just in the forked repo.


Thanks for writing Koala2, I hope that this issue can be resolved as I am really keen to compile a multi-sheet Excel spreadsheet tool1 into Python for modelling purposes2.

Does anyone have any suggestions?


1 The tool, for more details see The Irish National Building Energy Rating Assessment
2 Running Dublin-wide simulations of the energy/carbon impacts of different building-policy decisions

@kmonson
Copy link

kmonson commented May 6, 2020

In several places in Spreadsheet.py self.Range should be self.range. I'm about to fix that in one of my branches, but a pull request is a ways off.

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

No branches or pull requests

2 participants