Closed bradbase closed 5 years ago
I have run all the tests on my machine, all pass. Have also run both examples, both run. And the Travis tests (above Python 2.7 run)
needs a bugfix.
The bug I thought was there isn't.
There is certainly a bug.
It's not likely to affect the majority of users but is having an impact on my use case. So I'd say this PR is still ok.
I'm having trouble characterizing the bug though.
The bug is related to gen_graph no longer behaving correctly. Calling gen_graph looses state when you call it with arguments.
So this is fine: from koala.ExcelCompiler import ExcelCompiler from koala.tokenizer import ExcelParser excel_compiler = ExcelCompiler(file_name, ignore_sheets=ignore_sheets) excel_compiler.clean_pointer() excel_compiler.gen_graph()
This is also fine: from koala.ExcelCompiler import ExcelCompiler from koala.tokenizer import ExcelParser from koala.Spreadsheet import Spreadsheet excel_compiler = Spreadsheet.from_file_name(file_name, ignore_sheets=ignore_sheets) excel_compiler.clean_pointer() excel_compiler.gen_graph()
This looses named ranges: from koala.ExcelCompiler import ExcelCompiler from koala.tokenizer import ExcelParser excel_compiler = ExcelCompiler(file_name, ignore_sheets=ignore_sheets) excel_compiler.clean_pointer() parser = ExcelParser() tokens = parser.parse(model.formula) inputs = parser.getOperandRanges() excel_compiler.gen_graph(inputs=["Temp_min", "Temp_max"], outputs=["GrowingDegreesDay"])
And so does this: from koala.ExcelCompiler import ExcelCompiler from koala.tokenizer import ExcelParser from koala.Spreadsheet import Spreadsheet excel_compiler = Spreadsheet.from_file_name(file_name, ignore_sheets=ignore_sheets) excel_compiler.clean_pointer() parser = ExcelParser() tokens = parser.parse(model.formula) inputs = parser.getOperandRanges() excel_compiler.gen_graph(inputs=["Temp_min", "Temp_max"], outputs=["GrowingDegreesDay"])
I think it's to do with the call to read_named_ranges(). Moving the gen_graph method from ExcelCompiler to the Spreadsheet object has interrupted something or put it out of order.
Have fixed it. Will issue a new PR.