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

Prescriptor select #10

Merged
merged 11 commits into from
Sep 11, 2024
Merged

Prescriptor select #10

merged 11 commits into from
Sep 11, 2024

Conversation

danyoungday
Copy link
Collaborator

Created a nice, interactive way to filter out prescriptors to acquire desired behavior.

Refactored page to be nicer formatted via. bootstrap.

@danyoungday danyoungday self-assigned this Sep 11, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated readme to reflect new project structure

@@ -32,7 +31,7 @@
app.title = "Climate Change Decision Making"

context_component.register_callbacks(app)
parallel_component.register_callbacks(app)
filter_component.register_callbacks(app)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced parallel coordinates component with new filter component

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created some classes we can re-use between components

Starts by plotting "other" so that it's the bottom of the z axis.
Then plots selected candidates in color.
Finally plots the baseline on top.
"""
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved parallel coordinates code into filter.py

html.Div(
dbc.Accordion(
dbc.AccordionItem(dcc.Graph(id="parcoords-figure"), title="View Parallel Coordinates"),
start_collapsed=True,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide parallel coordinates in accordion dropdown

),
dbc.Col(
dbc.Button(
"Explore & Fine-Tune Policy in En-ROADS",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big fancy button to open En-ROADS to draw user in


if "baseline" in cand_idxs:
baseline_outcomes_df = outcomes_dfs[-1]
baseline_outcomes_df["year"] = list(range(1990, 2101))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer can toggle baseline nor other

@@ -13,6 +13,27 @@
from evolution.outcomes.outcome_manager import OutcomeManager


def filter_metrics_json(metrics_json: dict[str, list],
metric_ranges: list[tuple[float, float]],
normalize=False) -> pd.DataFrame:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this function into utils so it can be used in filtering too.

outcomes_dfs: list[pd.DataFrame]) -> pd.DataFrame:
"""
Takes parallel lists of context_actions_dicts and outcomes_dfs and processes them into a metrics dict.
All of these metrics dicts are then concatenated into a single DataFrame.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice for filtering

@danyoungday danyoungday merged commit 521a8f2 into main Sep 11, 2024
1 check passed
@danyoungday danyoungday deleted the presc-select branch September 11, 2024 18:22
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

Successfully merging this pull request may close these issues.

1 participant