Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More robust name validation #703

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

aeisenbarth
Copy link
Contributor

@aeisenbarth aeisenbarth commented Sep 9, 2024

Closes #624

  • This pull request changes name validation rules:
    • allow additionally . (now allowing _-. and alphanumeric, which includes 0-9a-zA-Z but also other Unicode like ɑ and ²)
    • forbid full names ., ..
    • forbid prefix __
    • forbid names only differing in character case, like abc, Abc (only one of them allowed, no matter which case)
  • Name validation is now also applied to AnnData tables (keys/columns in obs, obsm, obsp, var, varm, varp, uns).
    • For obs and var dataframes, _index is forbidden.
  • Validation happens at construction time when adding elements to an element type dictionary (as before).
  • Additionally, validation happens before writing to Zarr.

@aeisenbarth aeisenbarth marked this pull request as draft September 9, 2024 14:41
Copy link

codecov bot commented Sep 9, 2024

Codecov Report

Attention: Patch coverage is 98.85057% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.90%. Comparing base (8323e15) to head (a42d698).

Files with missing lines Patch % Lines
src/spatialdata/_core/spatialdata.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #703      +/-   ##
==========================================
+ Coverage   91.84%   91.90%   +0.06%     
==========================================
  Files          44       45       +1     
  Lines        6791     6846      +55     
==========================================
+ Hits         6237     6292      +55     
  Misses        554      554              
Files with missing lines Coverage Δ
src/spatialdata/_core/_elements.py 91.86% <100.00%> (-0.10%) ⬇️
src/spatialdata/_core/validation.py 100.00% <100.00%> (ø)
src/spatialdata/models/__init__.py 100.00% <100.00%> (ø)
src/spatialdata/models/models.py 87.71% <100.00%> (-0.11%) ⬇️
src/spatialdata/_core/spatialdata.py 90.88% <91.66%> (-0.02%) ⬇️

@aeisenbarth aeisenbarth marked this pull request as ready for review September 9, 2024 19:47
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.

Naming constraints break compatibility with existing datasets
1 participant