Conversation
- Move scripts in assets to contrib/india/maps, as they are India specific - Remove test, as not relevant for DPG - Move district_objectid.csv to data - Update docs accordingly - remove assets
…kebab-case for output/display columns - fix generic topsis script Note: the new outputs must be udpated at https://github.com/CivicDataLab/IDS-DRR-Data-Management/tree/main/layer/assets/indicators
- Remove Topsis class, convert to topsis fuction inside topsis_riskscore - Calculate the worst condition only (was the only method used) - User higher is better always (criteria was always True, True, True, True
- Output names don't need to be configurable, change them to const in common - topsis_riskscore.py now derives the factor columns and weight vector from one ordered FACTOR_WEIGHTS list - one spelling per config file
…del` package Move the flat scripts/ collection and config/loader.py into a src/-layout package and add packaging so the project is pip-installable, eliminating the sys.path.insert hack every script previously carried. - src/disaster_risk_score_model/: the four factor modules, topsis (was topsis_riskscore), sample_data (was generate_sample_data), dea, common, and a rewritten config loader. Intra-package absolute imports replace the sys.path manipulation; __main__ blocks are removed. - New cli.py exposes a single `drsm` console command (also runnable as `python -m disaster_risk_score_model`) with subcommands per stage plus init-config / generate-sample-data / run. - config.py gains command-generated-only config resolution (--config-dir / RISK_MODEL_CONFIG_DIR / ./config, else a clear error), an init_config scaffolder, and resolve_data_dir/resolve_input_file so I/O locations come from the CLI/env rather than the repo root. Factor/topsis main() functions take config_dir/data_dir/input_file; data paths resolve under --data-dir. - pyproject.toml (setuptools, deps, `drsm` entry point, bundled config templates as package data); requirements*.txt reduced to `-e .` / `-e .[dev]`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the six per-script config files (base + one per factor + topsis) with two files that `drsm init-config` scaffolds: - scores_config.toml: a shared [columns] table (single source of truth) plus a nested section per factor ([hazard.*], [exposure.*], [vulnerability.*], [govtresponse.*]). - topsis_config.toml: [weights] and [classification] (required) with the indicators/rounding/cumulative_vars/derivations/renames sections now optional. I/O locations leave the config entirely: [paths] is dropped: the data folder and input filename come from --data-dir/--input-file, and the TOPSIS district lookup and outputs are fixed names resolved under the data dir. The generic set ships as bundled package-data templates; the India example is migrated to the same two-file layout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Rewrite README, getting_started, the per-factor/topsis methodology docs, the India example README, CONTRIBUTING and SECURITY to use the `drsm` commands and the two-file config, replacing the old `python scripts/*.py` + per-file config references. - Drive the smoke test through the CLI (`python -m disaster_risk_score_model`) in a temp working dir; point test_dea at the package import; delete the obsolete sys.path conftest. - CI installs the package (`pip install -e .[dev]`) and sets MPLBACKEND=Agg. - Move data_dictionary.csv to docs/ (it is reference documentation, not data) and gitignore the top-level data/ wholesale: it is now just the default --data-dir scratch space, with MASTER_VARIABLES.csv / district_objectid.csv regenerated by `drsm generate-sample-data`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…non-configurable To more standard and generic names. Add checks to ensure they are present
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #2
closes #4
closes #1
See the commits for the detailed changes.
The tool is now a library, so it is easier to reuse. The library includes generating sample config files and synthetic data for testing in a new geography. I kept the Indian examples and specific scripts under contrib/india, however, I'm not sure if they are needed.
I'm also not sure if the hazard plot is needed (or all the prints).
Note that this changes the final output columns and format (for time_period). Also, the input column names.
The output column names are still kebab-cased and not snake_case; I'm not sure if this is needed.
A pypi.yml github action is still needed to automate the package publication