Modified asc_desc2horz_vert.py to specify different dataset for each input files
Description of proposed changes
Modified asc_desc2horz_vert.py to specify different dataset other than the same dataset for the two input files when decomposing to horizontal and vertical displacement/velocity.
Reminders
- [ ] Fix #xxxx
- [ ] Pass Pre-commit check (green)
- [ ] Pass Codacy code review (green)
- [ ] Pass Circle CI test (green)
- [ ] Make sure that your code follows our style. Use the other functions/files as a basis.
- [ ] If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
- [ ] If adding new functionality, add a detailed description to the documentation and/or an example.
Summary by Sourcery
Allow users to specify a different dataset name for each input file when converting ascending/descending measurements to horizontal and vertical components
New Features:
- Accept multiple dataset names via the -d/--dset CLI option to map one dataset per input file
- Use each provided dataset name when reading attributes and data for its corresponding file instead of assuming a single common dataset
Enhancements:
- Maintain backward compatibility by falling back to the original single-dataset behavior if only one name is given
Reviewer's guide (collapsed on small PRs)
Reviewer's Guide
Enable per-file dataset selection by converting the --dset/ ds_name parameter to a list, updating the CLI to accept multiple dataset names, and adjusting internal logic to read attributes and LOS data using the corresponding dataset entry for each input file.
Class diagram for updated input parameter handling in asc_desc2horz_vert.py
classDiagram
class Inps {
file: list[str]
ds_name: list[str] // now supports multiple dataset names
geom_file: list[str]
}
class run_asc_desc2horz_vert {
+run_asc_desc2horz_vert(inps: Inps)
}
Inps <.. run_asc_desc2horz_vert: uses
Flow diagram for per-file dataset selection in asc_desc2horz_vert.py
flowchart TD
A[Start] --> B[Parse CLI arguments]
B --> C{Are multiple datasets specified?}
C -- Yes --> D[Assign each ds_name to corresponding file]
C -- No --> E[Use single ds_name for both files]
D --> F[Read attributes and data per file/dataset]
E --> F
F --> G[Continue processing]
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Extend CLI to accept multiple dataset names for input files |
|
src/mintpy/cli/asc_desc2horz_vert.py |
| Update dataset handling in asc_desc2horz_vert.py to support per-file datasets |
|
src/mintpy/asc_desc2horz_vert.py |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
- Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. - Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.