Skip to content

Conversation

@Leguark
Copy link
Member

@Leguark Leguark commented May 26, 2025

Description

This PR refactors the ColorsGenerator class to use __post_init__ instead of __init__ and improves the basement color generation in StructuralFrame. The changes include:

  • Refactored ColorsGenerator to use __post_init__ for proper dataclass initialization
  • Added color_generator as a proper field with default factory in StructuralFrame
  • Improved basement color generation logic to ensure uniqueness
  • Fixed a tensor detachment issue in nugget optimization by converting to numpy
  • Removed unused imports in serialization and test modules
  • Updated test validation settings

Relates to #optimization-and-refactoring

Checklist

  • My code uses type hinting for function and method arguments and return values.
  • I have created tests which cover my code.
  • The test code either 1. demonstrates at least one valuable use case (e.g. integration tests) or 2. verifies that outputs are as expected for given inputs (e.g. unit tests).
  • New tests pass locally with my changes.

Copy link
Member Author

Leguark commented May 26, 2025

@Leguark Leguark force-pushed the serialize_opt_nugget branch from 325dae4 to 6b27207 Compare May 26, 2025 14:54
@Leguark Leguark force-pushed the fixed_serialization branch from 512780d to d26687b Compare May 26, 2025 14:54
@Leguark Leguark marked this pull request as ready for review May 26, 2025 14:56
@graphite-app graphite-app bot added the gempy 3 Will come with the next major update label May 26, 2025
@Leguark Leguark changed the title [ENH] Add default ColorsGenerator and improve condition handling [ENH] Fix color generator initialization and improve basement color handling May 26, 2025
@graphite-app
Copy link

graphite-app bot commented May 26, 2025

Graphite Automations

"Add gempy label" took an action on this PR • (05/26/25)

1 label was added to this PR based on Miguel de la Varga's automation.

@Leguark Leguark force-pushed the fixed_serialization branch from d26687b to ae311a2 Compare May 26, 2025 15:20
@Leguark Leguark marked this pull request as draft May 26, 2025 15:22
@Leguark Leguark force-pushed the fixed_serialization branch 3 times, most recently from 04d5d3a to ed7aa1a Compare May 26, 2025 16:00
@Leguark Leguark changed the base branch from serialize_opt_nugget to graphite-base/1038 May 26, 2025 16:04
@Leguark Leguark marked this pull request as ready for review May 26, 2025 16:04
Leguark added 2 commits May 26, 2025 17:05
Introduce `Field(default_factory=ColorsGenerator)` to `StructuralFrame` for streamlined initialization. Convert condition number to numpy array in optimization logic for compatibility. Minor adjustments made for improved model validation and notes added for future enhancements.
Introduce a method to allocate a unique basement color, avoiding duplication among structural elements. Minor enhancements include improved serialization output and cleanup of redundant or commented-out code.
@Leguark Leguark force-pushed the fixed_serialization branch from ed7aa1a to 9c0d434 Compare May 26, 2025 16:05
@graphite-app graphite-app bot changed the base branch from graphite-base/1038 to main May 26, 2025 16:06
@graphite-app
Copy link

graphite-app bot commented May 26, 2025

Merge activity

  • May 26, 4:06 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • May 26, 4:06 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@Leguark Leguark force-pushed the fixed_serialization branch from 9c0d434 to d10218d Compare May 27, 2025 07:12
@Leguark Leguark merged commit 3d14c7c into main May 27, 2025
2 checks passed
@Leguark Leguark deleted the fixed_serialization branch May 27, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gempy 3 Will come with the next major update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants