Repository navigation
Eac/shear table ids - #22
Merged
Merged
Conversation
Introduce ObjectShearTable (object_id + cluster_id + shear stats) and ClusterShearTable (cluster_id + shear stats) as subclasses of ShearTable. ShearTable.buildObjectShearStats and buildClusterShearStats now return the appropriate subclass with ids correctly populated. Both classes are exported from the package. Generated with AI Co-Authored-By: SLAC AI
…sterTable Both functions now accept an optional parquet file path: - buildJoinedObjectTable: object_shear=<path> joins ObjectShearTable on object_id; cluster_id is dropped before joining to avoid duplication - buildJoinedClusterTable: cluster_shear=<path> joins ClusterShearTable on cluster_id Also adds Path to imports and two new unit tests covering the new parameters. Generated with AI Co-Authored-By: SLAC AI
computeColumnStats(df, col_prefix, catalog_ids) collects all columns named
{col_prefix}_{cat_id} that exist in df and returns a DataFrame with
{col_prefix}_mean, {col_prefix}_std (ddof=1), and {col_prefix}_n, ignoring
NaN values (missing matches) row-wise. Catalog IDs whose column is absent
are silently skipped. Exported from the package.
Generated with AI
Co-Authored-By: SLAC AI
reduceJoinedTable(df, catalog_ids, keep_cols, drop_cols, stats_cols) applies
three operations in sequence:
1. Column selection: keep_cols if provided, else all minus drop_cols
2. Per-catalog column removal: strips {prefix}_{cat_id} for each stats prefix
3. Stats aggregation: appends {prefix}_mean/_std/_n via computeColumnStats
Generated with AI
Co-Authored-By: SLAC AI
Previously only {prefix}_{cat_id} variants were removed. Now any column
whose name exactly matches a prefix in stats_cols is dropped too, so a
bare "flux" column (e.g. from an object_shear join) is replaced along
with "flux_0", "flux_1", … by the aggregated flux_mean/std/n columns.
Generated with AI
Co-Authored-By: SLAC AI
Returns only {prefix}_mean and {prefix}_std. Updated docstring, empty-cols
fallback, and all affected tests.
Generated with AI
Co-Authored-By: SLAC AI
Instead of calling nanmean/nanstd over all rows and letting numpy warn on degenerate slices, pre-compute the per-row non-NaN count (n) and only call each function on rows where it is well-defined (n>=1 for mean, n>=2 for std). Rows with insufficient data remain NaN without any warning. Generated with AI Co-Authored-By: SLAC AI
n_sib_objects: number of objects in the parent cluster (len(cluster.objects))
n_sib_srcs: total sources across all objects in the parent cluster
(sum of o.n_src for o in cluster.objects)
Generated with AI
Co-Authored-By: SLAC AI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.