Skip to content

US_UrbanSchool_Algebra1 - #2252

Open
goutamabrol wants to merge 16 commits into
datacommonsorg:masterfrom
goutamabrol:schoolalgebra
Open

goutamabrol wants to merge 16 commits into
datacommonsorg:masterfrom
goutamabrol:schoolalgebra

Conversation

@goutamabrol

@goutamabrol goutamabrol commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refactors the US_UrbanSchool_Algebra1 (statvar_imports/school_algebra1) pipeline to separate raw data downloading from preprocessing, standardizes ncesid and YEAR generation across CRDC survey years (2009–2024), and updates the manifest and test fixtures.

PR Checklist doc - link

Changes

  • download_script.py: Decoupled in-place file mutation from downloading so raw CRDC files (.csv and .xlsx) in input_files/ remain intact; added dynamic survey year range detection and skipping for existing downloads.
  • preprocess_data.py: Added a dedicated preprocessing script that reads raw files from input_files/, constructs zero-padded 12-digit ncesid values (LEAID + SCHID or COMBOKEY), extracts the 4-digit survey completion YEAR, filters to columns mapped in Algebra1_pvmap.csv, and writes clean CSVs to processed_files/.
  • Algebra1_metadata.csv: Removed unused unit and scalingFactor columns from output_columns (observationDate,observationAbout,variableMeasured,value).
  • manifest.json:
    • Added preprocess_data.py to scripts and updated stat_var_processor.py to read processed_files/*.csv and output counters to counters/algebra1_counters.csv.
    • Added counters/*.csv and validation_config.json to source_files.
    • Added "node_mcf": "output/*.mcf" to import_inputs.
    • Updated resource_limits to default values (cpu: 8, memory: 32, disk: 100).
  • test_data/ & README.md: Regenerated input_test_data.csv and sample_output.csv to match the zero-padded ncesid and 4-column output schema, and updated README.md to document the 3-step workflow and 2009–2024 coverage.

Cloud Batch job (test) - link

Validation - link

CRA = link

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the school algebra 1 data import workflow by introducing a dedicated preprocessing step (preprocess_data.py), updating the download script to skip already downloaded files, and updating the manifest, metadata, and test data accordingly. Feedback on the changes suggests optimizing the survey year generation in download_script.py to use a step of 2 for biennial years, which avoids unnecessary download attempts for non-existent odd years.

Comment thread statvar_imports/school_algebra1/download_script.py Outdated
@datacommonsorg datacommonsorg deleted a comment from google-cla Bot Oct 5, 2026
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