Skip to content
Merged
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
37 changes: 34 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Code Style
- All files must end with a newline character
- Run `make lint` before committing to catch style issues
- **ALWAYS run `make format` before committing** - this will auto-fix most style issues
- Run `make lint` after formatting to check if there are any remaining issues
- **IMPORTANT**: `make format` will fail if there are lines over 79 characters that black can't fix (usually in strings/comments). You must manually break these lines.

## Changelog Requirements
- Every PR must include a `changelog_entry.yaml` file at the root
Expand All @@ -16,8 +18,14 @@
- The file must not be empty and must end with a newline

## Testing
- Run tests with: `python3 -m pytest microdf/tests/ -v`
- Install development dependencies first: `make install` or `pip install -e ".[dev]"`
- Run all tests: `make test` or `pytest -q --cov=microdf --cov-report=xml`
- Run specific test: `python3 -m pytest microdf/tests/test_microseries_dataframe.py::test_df_init -v`
- Ensure all tests pass before creating a PR
- If tests fail, check for:
- Missing `_link_all_weights()` calls after setting weights
- Proper handling of both array and string arguments in `set_weights()`
- Deprecation warnings properly configured with `stacklevel=2`

## Pull Request Process
1. Create a feature branch from master
Expand All @@ -33,4 +41,27 @@

## Documentation
- Documentation notebooks are in `docs/` directory
- When removing functionality, consider impact on documentation examples
- When removing functionality, consider impact on documentation examples

## Common CI Failures and Solutions

### Test Failures
1. **set_weights() with string not working**: Ensure `_link_all_weights()` is called for both string and array cases
2. **Deprecation warnings in tests**: Import warnings and suppress with `warnings.simplefilter("ignore", DeprecationWarning)` in test setup
3. **MicroSeries not properly linked**: Check that all DataFrame operations call `_link_all_weights()` after modifying structure

### Linting Failures
1. **Line length**: Run `make format` to auto-fix most issues
2. **Import order**: `isort` is configured to work with black, run `make format`
3. **Docstring formatting**: `docformatter` enforces 79-char wrapping, run `make format`
4. **File endings**: Ensure all files end with a newline

### Before Pushing
**CRITICAL: Always run these commands locally before pushing:**
```bash
make format # Auto-fix style issues (ALWAYS RUN THIS FIRST!)
make lint # Check for remaining issues (should pass after format)
make test # Run all tests
```

If CI fails with linting errors, it's almost always because `make format` wasn't run.
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ format:
isort --profile black microdf/
docformatter --wrap-summaries 79 --wrap-descriptions 79 --in-place --recursive microdf/
black . -l 79
@echo "Checking for lines that are too long (E501)..."
@if flake8 . --select=E501 --max-line-length=79 2>/dev/null | grep -q .; then \
echo "WARNING: The following lines are too long and must be manually fixed:"; \
flake8 . --select=E501 --max-line-length=79; \
echo "Please manually break these long strings/comments to be under 79 characters."; \
exit 1; \
fi

lint:
linecheck .
Expand Down
13 changes: 11 additions & 2 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
- bump: patch
changes:
changed:
- Move publishing to pypi to after versioning job.
fixed:
- MicroDataFrame.merge() now works correctly by implementing inplace support for the drop() method
- merge() now returns a MicroDataFrame instead of a regular DataFrame (Fixes #194)
- MicroDataFrame aggregation functions now skip non-numeric columns instead of raising errors (Fixes #213)
added:
- __getattr__ method to MicroDataFrame for intuitive column access via dot notation (Fixes #220)
- Full pandas argument support to drop() and merge() methods (Addresses #212)
- nullify_weights() method to both MicroDataFrame and MicroSeries to set all weights to 1 (Fixes #176)
- Test coverage for set_weights() with string column name argument
deprecated:
- set_weight_col() method - use set_weights() with a string argument instead (Fixes #208)
Loading