Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Background,
useNodesState,
useEdgesState,
addEdge,

Check failure on line 9 in src/App.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.11)

'addEdge' is defined but never used. Allowed unused vars must match /^[A-Z_]/u

Check failure on line 9 in src/App.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.10)

'addEdge' is defined but never used. Allowed unused vars must match /^[A-Z_]/u
} from '@xyflow/react';
import '@xyflow/react/dist/style.css';
import './App.css';
Expand Down Expand Up @@ -38,6 +38,7 @@
process_horizontal: ProcessNodeHorizontal,
delay: DelayNode,
constant: SourceNode,
source: SourceNode,
stepsource: StepSourceNode,
pulsesource: SourceNode,
amplifier: AmplifierNode,
Expand Down Expand Up @@ -804,7 +805,7 @@
return () => {
document.removeEventListener('keydown', handleKeyDown);
};
}, [selectedEdge, selectedNode, copiedNode, duplicateNode, setCopyFeedback]);

Check warning on line 808 in src/App.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.11)

React Hook useEffect has missing dependencies: 'deleteSelectedEdge' and 'deleteSelectedNode'. Either include them or remove the dependency array

Check warning on line 808 in src/App.jsx

View workflow job for this annotation

GitHub Actions / test (20.x, 3.10)

React Hook useEffect has missing dependencies: 'deleteSelectedEdge' and 'deleteSelectedNode'. Either include them or remove the dependency array

return (
<div style={{ width: '100vw', height: '100vh', position: 'relative' }}>
Expand Down
10 changes: 10 additions & 0 deletions src/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ def get_default_values(node_type):
default_values[param] = None # Handle empty defaults
else:
default_values[param] = default_value
# check if default value is serializable to JSON
if not isinstance(
default_value, (int, float, str, bool, list, dict)
):
# Attempt to convert to JSON serializable type
try:
default_values[param] = json.dumps(default_value)
except TypeError:
# If conversion fails, set to a string 'default'
default_values[param] = "default"
return jsonify(default_values)
except Exception as e:
return jsonify(
Expand Down
2 changes: 2 additions & 0 deletions src/pathsim_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Scope,
Block,
Constant,
Source,
StepSource,
PulseSource,
Amplifier,
Expand Down Expand Up @@ -40,6 +41,7 @@
}
map_str_to_object = {
"constant": Constant,
"source": Source,
"stepsource": StepSource,
"pulsesource": PulseSource,
"amplifier": Amplifier,
Expand Down
Loading