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

refactor #26

Closed
cbini opened this issue Apr 26, 2022 · 0 comments
Closed

refactor #26

cbini opened this issue Apr 26, 2022 · 0 comments

Comments

@cbini
Copy link
Member

cbini commented Apr 26, 2022

only while loop, allow input for all vars

def generate_historical_queries(year_id, selector, max_value=None):
# transform yearid to constraint value
if not max_value:
max_value = transform_year_id(year_id, selector)
# get step and stoppage critera for constraint type
constraint_rules = get_constraint_rules(selector, year_id, is_historical=True)
stop_value = constraint_rules["stop"]
step_size = constraint_rules["step_size"]
# generate probing queries
working_value = max_value
probing_query_expressions = []
while (working_value + step_size) >= stop_value:
constraint_values = get_constraint_values(selector, working_value, step_size)
query_expression = get_query_expression(selector, **constraint_values)
probing_query_expressions.append(query_expression)
working_value = working_value - step_size
return probing_query_expressions

@cbini cbini closed this as completed Apr 27, 2022
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

1 participant