Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- Deprecation warnings properly configured with `stacklevel=2`

## Pull Request Process
1. Create a feature branch from master
1. Create a feature branch from main
2. Make changes and ensure they follow code style guidelines
3. Add a changelog entry
4. Create PR with descriptive title and body
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build](https://github.com/PolicyEngine/microdf/workflows/Pull%20request/badge.svg)](https://github.com/PolicyEngine/microdf/actions)
[![Codecov](https://codecov.io/gh/PolicyEngine/microdf/branch/master/graph/badge.svg)](https://codecov.io/gh/PolicyEngine/microdf)
[![Codecov](https://codecov.io/gh/PolicyEngine/microdf/branch/main/graph/badge.svg)](https://codecov.io/gh/PolicyEngine/microdf)

# microdf
Weighted pandas DataFrames and Series for survey microdata analysis.
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Presets for working with common datasets, e.g. suggesting the appropriate weight for SCF and CPS
* Standard error calculations for surveys with replicate weight files

See the [issues page](https://github.com/PSLmodels/microdf/issues) to view and suggest other items.
See the [issues page](https://github.com/PolicyEngine/microdf/issues) to view and suggest other items.
7 changes: 7 additions & 0 deletions changelog.d/version-and-stale-refs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- bump: patch
changes:
fixed:
- __version__ is now read from package metadata instead of a hardcoded
0.1.0 that had drifted from pyproject.toml.
- Codecov badge, ROADMAP issue link and CLAUDE.md branch name now point at
main and the PolicyEngine org.
10 changes: 9 additions & 1 deletion microdf/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from importlib.metadata import PackageNotFoundError, version

from .microdataframe import MicroDataFrame, MicroDataFrameGroupBy
from .microseries import MicroSeries, MicroSeriesGroupBy

name = "microdf"
__version__ = "0.1.0"

# Read the version from package metadata so it can't drift from
# pyproject.toml (the automated bump only touches pyproject).
try:
__version__ = version("microdf-python")
except PackageNotFoundError: # pragma: no cover - running from a source tree
__version__ = "unknown"

__all__ = [
# microseries.py
Expand Down
7 changes: 7 additions & 0 deletions microdf/tests/test_microseries_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,3 +815,10 @@ def test_rank_ties_share_bucket() -> None:
# existing ``test_rank`` expectations hold.
s = mdf.MicroSeries([1, 2, 3], weights=[4, 5, 6])
np.testing.assert_array_equal(s.rank().values, [4, 9, 15])


def test_version_matches_package_metadata():
"""__version__ must not drift from pyproject.toml."""
from importlib.metadata import version

assert mdf.__version__ == version("microdf-python")
Loading