Skip to content

🔀 Feature/renaming cli command#3

Merged
MemoOlv merged 8 commits into
developfrom
feature/renaming_cli_command
May 11, 2026
Merged

🔀 Feature/renaming cli command#3
MemoOlv merged 8 commits into
developfrom
feature/renaming_cli_command

Conversation

@mvillasante
Copy link
Copy Markdown
Member

@mvillasante mvillasante commented May 11, 2026

Summary

  • Rename the CLI command plot-population-trend to render-population-trend, marking the old name as deprecated.
  • Guard all deploy/publish steps (Docker push, PyPI) so they only execute on the develop branch, preventing accidental releases from feature/*
    branches.
  • Extract shared plotting logic into a private _render_population_trend() helper to eliminate duplication between old and new commands.

Changes

CLI (population_trend/cli.py)

  • Added render-population-trend command (same interface, same behavior).
  • Deprecated plot-population-trend with:
    • Typer deprecated=True flag;
    • typer.secho() yellow warning to stderr at invocation;
    • warnings.warn(DeprecationWarning) for programmatic consumers.
  • Both commands delegate to a single _render_population_trend() private function (DRY).

CI/CD (.github/workflows/actions.yml)

  • Added feature/* to push triggers.
  • Wrapped every deploy/publish step with if: github.ref_name == 'develop' so feature branches run tests/lint only.

Changelog (CHANGELOG.md)

  • Documented the new command under Added.
  • Documented deprecation notice under Deprecated with the planned removal version (v6.0.0).

Refactoring (population_trend/population_growth_model.py)

  • Refactored set_labels() to use a dictionary structure, laying groundwork for future localization (extensibility without behavioral change).

Tests (tests/test_cli.py, tests/test_Population_trend.py)

  • Fixed variable ordering (Plotter moved after Sparse_Plotter).
  • Updated test data path references (replaced output_figure with data_path_for_trend).
  • Enhanced test_app_plot_population_trend to verify deprecation notice and new command name appear in help output.
  • Added test_render_population_trend_new_command_works to validate the new command produces output correctly.

Migration path

Users can safely replace plot-population-trend with render-population-trend in scripts. The old name continues to work but emits deprecation warnings. Removal is planned for v6.0.0.

Copy link
Copy Markdown
Member

@MemoOlv MemoOlv left a comment

Choose a reason for hiding this comment

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

Checklist for Pull Request

  • Small: The pull request has fewer than 100 lines. Not fewer than 100 lines but OK. 109-12=97
  • Passing: The CI pipeline is passing.
  • Technical debt reduction: Did we reduce any form of technical debt? Are we confident that this change did not introduce or increase technical debt?

  • Complexity: Could the code be made simpler? Would another developer be able to easily understand and use this code when they come across it in the future? Is this code adding functionality that isn't presently needed?
  • Design: Is the code well-designed and appropriate for your system?
  • Tests: Does the code have correct and well-designed automated tests? Does the code behave as the author likely intended?
  • Interface: Any interface changes are sensible and look good. Is the way the code behaves good for its users?

We need to add the v5.11.0 version.

  • CHANGELOG.md: Are the changes recorded in this file following this standard?
  • Versioning: Are version numbers updated according to semantic versioning guidelines (e.g., MAJOR.MINOR.PATCH)?
  • Documentation: Did the developer also update relevant documentation? Does the exposed functions have docstrigns? No tenemos pero nos vamos a pasar de líneas.
  • ~~ CITATION.cff: Is the citation files included and updated following the this standard? Aquí y aquí hay ejemplos.~~No tenemos pero nos vamos a pasar de líneas.

  • Naming: Did the developer choose clear names for variables, classes, methods, etc.? Did we replace unnecessary comments with clear variable names, well-named functions, and small cohesive blocks?
  • Style: Does the code follow our style guides? Function _render_population_trend() is going to change in next PR.

  • YAGNI: The developer is not implementing things they might need in the future but don’t know they need now.
  • Good Things: If you see something nice in the pull request, tell the developer, especially when they addressed one of your comments in a great way.

Copy link
Copy Markdown
Member

@MemoOlv MemoOlv left a comment

Choose a reason for hiding this comment

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

Please, update version in CHANGELOG

Comment thread CHANGELOG.md
@mvillasante mvillasante requested a review from MemoOlv May 11, 2026 20:27
Copy link
Copy Markdown
Member

@MemoOlv MemoOlv left a comment

Choose a reason for hiding this comment

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

👍🏾 LGTM

@MemoOlv MemoOlv merged commit cf1fd1d into develop May 11, 2026
2 checks passed
@MemoOlv MemoOlv deleted the feature/renaming_cli_command branch May 11, 2026 20:29
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.

2 participants