Ruff formatting, lint/codacy fixes, and dead-code cleanup - #33
Merged
Conversation
Adds a pre-commit-driven ruff format + ruff check pass across src/ivert (E721, E402, E711/E712, E741, F401/F841, invalid escape sequences) and whitespace/end-of-file fixes across archive/. Excludes archive/ from ruff's linting (extend-exclude in pyproject.toml) since it's deprecated reference-only code with a large volume of dead-code findings not worth hand-fixing.
The block called clean_ivert_files.disk_usage_pct(), .delete_local_photon_tiles(), .clean_cudem_cache(), and ivert_jobs.list_running_ivert_jobs() without ever importing those names (ruff F821) — it would have crashed with a NameError the moment disk usage on an AWS server instance exceeded the configured threshold. Also drops the now-unused is_aws and configfile imports that only served this block.
Nothing in src/ivert/ imports it (grep confirms only self-references remain after the dead disk-cleanup block was removed).
Repo moved from ciresdem/IVERT to continuous-dems/ivert.
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.
Summary
ruff format+ruff check --fixpass and hand-fixes the remaining lint/codacy findings insrc/ivert/(E721, E402, E711/E712, E741, F401/F841, invalid escape sequences).archive/is excluded from ruff linting (extend-excludeinpyproject.toml) since it's deprecated reference-only code; other pre-commit hooks (end-of-file-fixer, trailing-whitespace) still ran on it.validate_dem_collection.pythat referencedclean_ivert_filesandivert_jobswithout ever importing them (ruff F821) — it would have raised aNameErrorthe first time disk usage on an AWS server instance crossed the configured threshold.ivert_jobs.pytoarchive/src/(nothing insrc/ivert/imports it after the dead-code removal above).pyproject.toml, which still pointed at the pre-transferciresdem/IVERTrepo.Test plan
ruff check .— all checks passruff format --check .— all files formattedivert,ivert.validate_dem_collection,ivert.cli)ivert_jobsoutside itself before archiving