[Issue 528] Make cluster point process code more general by fixing hard coded values#937
Open
CodersRepo wants to merge 4 commits into
Open
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…g, and seed label
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
Tools/InputGeneration/ClusterPointProcess/cluster_point_process.py:626
- The GUI validation currently attempts to cast every non-seed field to float (including "Graph ID:"). GraphML node IDs are strings and may be non-numeric; even numeric IDs can be entered as "194.0"/"1e2" which passes float() but won’t match the actual node key, leading to a confusing KeyError later. Treat Graph ID as a string (or validate it as an integer-like string) and defer existence checking to the graph lookup.
else:
try:
float(text) # Attempt to convert to float to check validity
except ValueError:
Tools/InputGeneration/ClusterPointProcess/cluster_point_process.py:650
- The warning text says "(float values only)", but this form now includes an integer-only seed field and (ideally) a string graph id. This message is now misleading; update it to reflect per-field expectations (e.g., numeric fields vs optional integer seed vs string graph id).
if invalid_fields:
error_message = "Invalid or empty values in the following fields: (float values only)\n"
for field in invalid_fields:
error_message += f"- {field}\n"
Comment on lines
+126
to
+130
| if prototype_weights is None: | ||
| if n == len(DEFAULT_LEGACY_PROTOTYPE_WEIGHTS): | ||
| w = np.array(DEFAULT_LEGACY_PROTOTYPE_WEIGHTS, dtype=float) | ||
| else: | ||
| w = np.ones(n, dtype=float) / n |
Contributor
|
There are a lot of changes here, and while I could just approve it, I think we need to take advantage of this as a opportunity to add in testing so we can be confident that it produces good output. Here are my suggestions:
|
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.
…ph path
Closes #528
Description
Cluster point process: configurable params, JSON CLI, fix ignored graph path
Use the graph file chosen in the UI instead of a hardcoded spd.graphml path.
Add generate_cluster_point_process_xml() for shared GUI/CLI generation with
optional RNG seed, prototype selection weights, and XML clock attributes.
Extend secprocess() with optional prototype_weights; keep legacy 40/50/9/1
weights for four prototypes when weights are omitted; factor Tukey fence
constant. Add --config for headless runs from JSON; validate graph path and
fix mismatched error labels.
Checklist (Mandatory for new features)
Testing (Mandatory for all changes)
test-medium-connected.xmlPassedtest-large-long.xmlPassed