Skip to content

[Proposal] Add warning message when setParam fails silently #835

@PratapShashwat

Description

@PratapShashwat

Description
While working on PEP8 cleanups in netpyne/specs/netParams.py, I noticed that setParam and similar methods fail silently when a label is not found.

Current Behavior

if label in self:
    d = self[label]
else:
    return False  # Silently fails, user is not notified

Proposed Improvement
I propose adding an explicit warning so users can debug their scripts easier:

else:
    print(f\"Warning: Label '{label}' not found. Parameter '{param}' not set.\")
    return False

Question
Should I include this UX improvement as part of the PEP8 cleanup PR, or would you prefer a separate PR for this logic change?"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions