Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rename basefactory populations#990

Open
Zeyadzahran wants to merge 10 commits into
radis:developfrom
Zeyadzahran:rename-basefactory-populations
Open

Rename basefactory populations#990
Zeyadzahran wants to merge 10 commits into
radis:developfrom
Zeyadzahran:rename-basefactory-populations

Conversation

@Zeyadzahran
Copy link
Copy Markdown
Contributor

Description

This PR addresses the TODO: rename base.py and BaseFactory to more explicit populations.py and PopulationFactory ? in LONG TERM TODO #53.

The name PopulationFactory makes a lot more sense for what this class actually does.

Changes made:

  • Renamed radis/lbl/base.py to radis/lbl/populations.py.
  • Renamed the BaseFactory class to PopulationFactory globally.
  • Renamed test_base.py to test_populations.py and updated all internal imports, references, and docs.
  • Backward compatibility: Added a deprecated alias (from .populations import PopulationFactory as BaseFactory) in radis/lbl/__init__.py so we don't break existing user code after the update.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.18%. Comparing base (e457a8d) to head (92bb130).
⚠️ Report is 42 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #990      +/-   ##
===========================================
- Coverage    70.21%   70.18%   -0.04%     
===========================================
  Files           99      100       +1     
  Lines        18931    18953      +22     
===========================================
+ Hits         13293    13302       +9     
- Misses        5638     5651      +13     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI review requested due to automatic review settings April 2, 2026 06:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR renames the former BaseFactory implementation to PopulationFactory and migrates the core implementation from radis/lbl/base.py to radis/lbl/populations.py, updating imports and documentation to match while attempting to preserve backward compatibility.

Changes:

  • Updated internal imports/references from radis.lbl.base / BaseFactory to radis.lbl.populations / PopulationFactory.
  • Reworked radis/lbl/base.py into a backward-compatibility shim that forwards to populations.
  • Updated tests and documentation to point at the new module/class names.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
radis/test/lbl/test_populations.py Updates imports/docstrings to reference radis.lbl.populations and PopulationFactory.
radis/test/lbl/test_loader.py Fixes doc references for DatabankLoader location.
radis/spectrum/spectrum.py Updates commented import path to the renamed module.
radis/lbl/loader.py Updates inheritance-chain docs to PopulationFactory.
radis/lbl/factory.py Switches get_wavenumber_range import to populations and updates TODO wording.
radis/lbl/calc.py Switches get_wavenumber_range import to populations.
radis/lbl/broadening.py Updates base class/import from BaseFactory to PopulationFactory.
radis/lbl/base.py Replaces implementation with a deprecation shim forwarding to populations.
radis/lbl/bands.py Updates inheritance-chain docs to PopulationFactory.
radis/lbl/init.py Adds PopulationFactory export and BaseFactory alias for compatibility.
radis/api/exomolapi.py Updates import for linestrength_from_Einstein to new module path.
docs/lbl/lbl.rst Updates docs reference to PopulationFactory.plot_linestrength_hist.
docs/dev/_architecture.rst Updates architecture docs to PopulationFactory (but still has a couple stale method names).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radis/lbl/__init__.py Outdated
Comment thread radis/lbl/base.py
Comment thread docs/dev/_architecture.rst Outdated
@Zeyadzahran
Copy link
Copy Markdown
Contributor Author

I realized we needed a compatibility shim to handle historical imports (like from radis.lbl.base import ...). I added base.py back, but I used __getattr__ for the warning. This way, it only triggers if someone specifically imports the deprecated BaseFactory, which prevents spamming users who just need unchanged helper functions from that old path.

@Zeyadzahran
Copy link
Copy Markdown
Contributor Author

Can you please take a look @minouHub , @Prtm2110

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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