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

type error occur when using bid file #25

Open
WhitejadeHang opened this issue Oct 25, 2022 · 1 comment
Open

type error occur when using bid file #25

WhitejadeHang opened this issue Oct 25, 2022 · 1 comment

Comments

@WhitejadeHang
Copy link

When I add costcurvepointsfilename in generator , the console throw out this:
Traceback (most recent call last):
File "/root/miniconda3/bin/minpower", line 8, in
sys.exit(main())
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 309, in main
solve_problem(directory)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 157, in solve_problem
solution = create_solve_problem(power_system, times, scenario_tree)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/solve.py", line 223, in create_solve_problem
sln = results.make_solution(power_system, times)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 84, in make_solution
return problem_type[kind](power_system, times, **kwargs)
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 116, in init
self._get_costs()
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 166, in _get_costs
self.incremental_cost = self.gen_time_df("incrementalcost")
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 147, in gen_time_df
[self.get_values(generators, method, t, evaluate) for t in times],
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 147, in
[self.get_values(generators, method, t, evaluate) for t in times],
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 135, in get_values
out = [value(getattr(obj, method)(time)) for obj in items]
File "/root/miniconda3/lib/python3.8/site-packages/minpower/results.py", line 135, in
out = [value(getattr(obj, method)(time)) for obj in items]
File "/root/miniconda3/lib/python3.8/site-packages/minpower/generators.py", line 166, in incrementalcost
self.bids.output_incremental(self.power(time, scenario))
File "/root/miniconda3/lib/python3.8/site-packages/minpower/bidding.py", line 146, in output_incremental
if A[0] <= input_val <= B[0]:
TypeError: '<=' not supported between instances of 'str' and 'float'

it seems that the output_incremental function picks up wrong data from the raw file using:
for A, B in pairwise(self.bid_points):
should use:
for A, B in pairwise(self.bid_points.values.tolist()):
instead

@adamgreenhall
Copy link
Owner

Your suggestion makes sense. Feel free to open a PR!

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