Agent skill
orcaflex-model-generator-mergeobject
Sub-skill of orcaflex-model-generator: _merge_object() (+2).
Install this agent skill to your Project
npx add-skill https://github.com/vamseeachanta/workspace-hub/tree/main/.claude/skills/_archive/engineering/marine-offshore/orcaflex-model-generator/mergeobject
SKILL.md
_merge_object() (+2)
_merge_object()
Combines typed Pydantic fields with pass-through properties:
@staticmethod
def _merge_object(obj: GenericObject) -> dict[str, Any]:
merged = dict(obj.properties) # 1. Start from properties bag
explicitly_set = obj.model_fields_set # 2. Track what was explicitly set
for py_field, ofx_key in TYPED_FIELD_MAP.items():
value = getattr(obj, py_field, None)
if value is not None:
merged[ofx_key] = value # 3. Non-None typed fields override
elif py_field in explicitly_set:
merged[ofx_key] = value # 4. Explicitly-set None preserved
# 5. Priority keys first (Name, Category, ShapeType, etc.)
ordered = {}
for key in _PRIORITY_KEYS:
if key in merged:
ordered[key] = merged.pop(key)
ordered.update(merged)
return ordered
Section Ordering (_SECTION_ORDER)
Critical: OrcaFlex validates references sequentially. Sections must appear in dependency order:
General → VariableData → ExpansionTables
→ RayleighDampingCoefficients, FrictionCoefficients, LineContactData
→ LineTypes, VesselTypes, ClumpTypes, StiffenerTypes, SupportTypes
→ Vessels, Lines, Shapes, 6DBuoys, 3DBuoys, Constraints, Links, Winches
→ MultibodyGroups, BrowserGroups, Groups
Priority Keys (_PRIORITY_KEYS)
Mode-setting properties must appear before dependent properties within each object:
_PRIORITY_KEYS = [
"Name", "Category", "ShapeType", "Shape", "BuoyType",
"Connection", "LinkType", "Geometry", "WaveType",
"DegreesOfFreedomInStatics",
]
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gsd-complete-milestone
Archive completed milestone and prepare for next version
gsd-reapply-patches
Reapply local modifications after a GSD update
gsd-verify-work
Validate built features through conversational UAT
gsd-thread
Manage persistent context threads for cross-session work
clinical-trial-protocol
Generate clinical trial protocols for medical devices or drugs through a modular, waypoint-based architecture with research-only and full protocol modes.
single-cell-rna-qc
Performs quality control on single-cell RNA-seq data (.h5ad or .h5 files) using scverse best practices with MAD-based filtering and comprehensive visualizations.
Didn't find tool you were looking for?