Skip to content

Feature/cutsky factory#279

Draft
hbrincon wants to merge 10 commits into
devfrom
feature/cutsky-factory
Draft

Feature/cutsky factory#279
hbrincon wants to merge 10 commits into
devfrom
feature/cutsky-factory

Conversation

@hbrincon

Copy link
Copy Markdown
Collaborator

Draft PR for comments

@SBouchard01
SBouchard01 self-requested a review July 15, 2026 15:40
@SBouchard01 SBouchard01 added the Galaxy catalogs Related to acm.hod label Jul 15, 2026
@SBouchard01 SBouchard01 linked an issue Jul 15, 2026 that may be closed by this pull request
@SBouchard01
SBouchard01 marked this pull request as draft July 15, 2026 15:42
Comment on lines 195 to 197
cache_key = (self.ngal, self._transform_state)
if cache_key in self._fsky_cache:
return self._fsky_cache[cache_key]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could use native cache properties instead ?

@hbrincon hbrincon Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I didn't write this code, so I'm less familiar with what it's doing. My understanding is that ngal and _transform_state both return mutable values, so would we need to define __eq__ and __hash__ for BaseGalaxyCatalog and use @lru_cache for the two methods?

Comment thread acm/catalogs/factories/cutsky.py Outdated
Comment thread acm/catalogs/factories/cutsky.py Outdated
Comment on lines +179 to +196
pos_min, pos_max = self.get_reference_borders(
zranges,
boxsize,
region=region,
release=release,
program = program,
tracer = mask_tracer,
custom_healpix_mask=custom_healpix_mask,
)
shifts = self.get_box_shifts(pos_min, pos_max, boxsize)
# doesn't make sense to have snapshotcatalog as input (multitracer) while having dataframe as output (all tracers forced into single dataframe)
replications = self.get_box_replications(
snapshot_catalog,
pos_min,
pos_max,
shifts=shifts,
distance_limits = (distance_limits[0], distance_limits[1]),
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Question 1: could those be used as external helpers or staticmethods ? (rule of thumb is that if you don't need self in the method, it should be OK to move it as a static method or an external function)

Question 2: could we move the tiling functions to SnapshotCatalog (either as staticmethods or helpers ?)

@hbrincon hbrincon Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

self is used in both of these methods though, or maybe I'm misunderstanding the request. What did you mean?

I lean towards keeping the tiling in cutsky since it is really part of defining the cutsky geometry, but I could be convinced otherwise (since you're the one developing the snapshot classes, I'll let you implement that if you like)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Galaxy catalogs Related to acm.hod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add acm.hod functionalities in acm.catalogs

2 participants