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

608 equity metrics calculation #612

Merged
merged 5 commits into from
Oct 21, 2024
Merged

Conversation

longshuicy
Copy link
Member

Equity Metric takes 3 input:

  • HUA Household inventory with sociodemographic characterization (or any characterization for which
    can divide into two groups)
  • Scarce Resource (could be anything, in this case we use return time calculated from HHRS)
  • A Division decision variable column name that can divide a given household into 2 groups (e.g. low income vs non low income, minority vs non-minority). In this case, we calculate the social vulnerability index (SVI)

I made the algorithm generic regardless of what scarce resource and division decision variable


To test:

run tests/pyincore/analyses/equitymetric/test_equitymetric.py

@longshuicy longshuicy linked an issue Sep 3, 2024 that may be closed by this pull request
@navarroc
Copy link
Member

Since this is a new analysis, we need to update the pyincore doc folder so the methods get attended to the pyincore documentation.

@navarroc
Copy link
Member

navarroc commented Oct 7, 2024

@longshuicy It's minor, but can you add the equitymetrics analysis to the modules.rst in the docs folder? Thanks!

@navarroc
Copy link
Member

I noticed that there is a file written "scarce_resource" in the test folder when the analysis exits. Is that supposed to be there? I only see one output listed in the spec.

@longshuicy
Copy link
Member Author

I noticed that there is a file written "scarce_resource" in the test folder when the analysis exits. Is that supposed to be there? I only see one output listed in the spec.

That's the example I'm preparing the input datasets.

# prepare input dataset
    return_df = Dataset.from_data_service(
        "66d7763b43810e1298b0e8b1", datasvc
    ).get_dataframe_from_csv()
    scarce_resource_df = EquityMetricUtil.prepare_return_time_as_scarce_resource(
        return_df
    )
    scarce_resource = Dataset.from_dataframe(
        scarce_resource_df, "scarce_resource", data_type="incore:scarceResource"
    )
    ```

Since anything could be scarce resources, if anyone has brought in their own, they don't have the run above code to generate that input.

@ywkim312
Copy link
Member

The test run finished without error and did not create any result or any output. The code looks like it doesn't produce any output. This is okay, right?

@longshuicy
Copy link
Member Author

The test run finished without error and did not create any result or any output. The code looks like it doesn't produce any output. This is okay, right?

It should produce 2 files. The .csv is the final output.
Could you double check how you run the test file? I saw you approved the notebook, assuming it should run file with jupyter notebook.
Thanks!
image

@ywkim312 ywkim312 merged commit 4162ac7 into develop Oct 21, 2024
7 checks passed
@ywkim312 ywkim312 deleted the 608-equity-metrics-calculation branch October 21, 2024 20:10
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.

Equity Metrics Calculation
3 participants