Fixed to filter for non-existing elements when initializing from a setting file

This commit is contained in:
2026-01-26 11:04:58 +01:00
parent d3094958aa
commit 9e4cb435d3
6 changed files with 82 additions and 40 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="python3" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="$USER_HOME$/miniforge3/envs/sfbd" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+74 -35
View File
@@ -4,18 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="0efcf7ff-c00b-4b53-9800-80ad65aeaff9" name="Changes" comment="Plotting of elegant results implemented">
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ElegantTools.py" beforeDir="false" afterPath="$PROJECT_DIR$/ElegantTools.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lattice.py" beforeDir="false" afterPath="$PROJECT_DIR$/lattice.py" afterDir="false" />
<list default="true" id="0efcf7ff-c00b-4b53-9800-80ad65aeaff9" name="Changes" comment="First release of ElegantTools">
<change beforePath="$PROJECT_DIR$/.idea/ElegantTools.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/ElegantTools.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/model.py" beforeDir="false" afterPath="$PROJECT_DIR$/model.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/plot.py" beforeDir="false" afterPath="$PROJECT_DIR$/plot.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/track.py" beforeDir="false" afterPath="$PROJECT_DIR$/track.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/ElegantPlotGui.py" beforeDir="false" afterPath="$PROJECT_DIR$/ui/ElegantPlotGui.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/ElegantToolsGui.py" beforeDir="false" afterPath="$PROJECT_DIR$/ui/ElegantToolsGui.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ui/ElegantToolsGui.ui" beforeDir="false" afterPath="$PROJECT_DIR$/ui/ElegantToolsGui.ui" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -32,6 +27,10 @@
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="McpProjectServerCommands">
<commands />
<urls />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 3
}</component>
@@ -40,31 +39,38 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
&quot;Python.ElegantTools.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;SHELLCHECK.PATH&quot;: &quot;I do mind&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/reiche/Desktop/Software/ElegantTools&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;com.intellij.pycharm.community.ide.impl.configuration.PythonContentEntriesConfigurable&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ModuleVcsDetector.initialDetectionPerformed": "true",
"Python.ElegantTools.executor": "Run",
"RunOnceActivity.MCP Project settings loaded": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
"RunOnceActivity.git.unshallow": "true",
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
"SHELLCHECK.PATH": "I do mind",
"ai.playground.ignore.import.keys.banner.in.settings": "true",
"com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
"git-widget-placeholder": "main",
"junie.onboarding.icon.badge.shown": "true",
"last_opened_file_path": "/home/reiche/Codes/Python/Modelling/ElegantTools",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
"to.speed.mode.migration.done": "true",
"vue.rearranger.settings.migration": "true"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/Runs" />
<recent name="$PROJECT_DIR$/OnlineModelLattices" />
<recent name="$PROJECT_DIR$" />
<recent name="$PROJECT_DIR$/ReferenceDistribution" />
<recent name="$PROJECT_DIR$/rsc" />
<recent name="$PROJECT_DIR$/.." />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/ReferenceDistribution" />
@@ -82,11 +88,13 @@
<env name="PYTHONPATH" value="/sf/bd/packages/onlinemodel:/sf/bd/packages/sfbd:$PYTHONPATH" />
</envs>
<option name="SDK_HOME" value="" />
<option name="SDK_NAME" value="sfbd" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="RUN_TOOL" value="" />
<option name="SCRIPT_NAME" value="ElegantTools.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
@@ -100,8 +108,8 @@
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-js-predefined-d6986cc7102b-09060db00ec0-JavaScript-PY-251.26927.90" />
<option value="bundled-python-sdk-41e8cd69c857-64d779b69b7a-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-251.26927.90" />
<option value="bundled-js-predefined-d6986cc7102b-9b0f141eb926-JavaScript-PY-253.29346.308" />
<option value="bundled-python-sdk-ca5e2b39c7df-6e1f45a539f7-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-253.29346.308" />
</set>
</attachedChunks>
</component>
@@ -113,7 +121,10 @@
<option name="presentableId" value="Default" />
<updated>1752559006350</updated>
<workItem from="1752559007381" duration="52441000" />
<workItem from="1753184384816" duration="37200000" />
<workItem from="1753184384816" duration="49046000" />
<workItem from="1753433608932" duration="2368000" />
<workItem from="1753700276583" duration="1239000" />
<workItem from="1769421276584" duration="540000" />
</task>
<task id="LOCAL-00001" summary="Initial Commit">
<option name="closed" value="true" />
@@ -163,18 +174,46 @@
<option name="project" value="LOCAL" />
<updated>1753350076881</updated>
</task>
<option name="localTasksCounter" value="7" />
<task id="LOCAL-00007" summary="First release of ElegantTools">
<option name="closed" value="true" />
<created>1753432990655</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1753432990655</updated>
</task>
<task id="LOCAL-00008" summary="First release of ElegantTools">
<option name="closed" value="true" />
<created>1753433183193</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1753433183193</updated>
</task>
<option name="localTasksCounter" value="9" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Initial Commit" />
<MESSAGE value="Plotting of elegant results implemented" />
<option name="LAST_COMMIT_MESSAGE" value="Plotting of elegant results implemented" />
<MESSAGE value="First release of ElegantTools" />
<option name="LAST_COMMIT_MESSAGE" value="First release of ElegantTools" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/ElegantTools$ElegantTools.coverage" NAME="ElegantTools Coverage Results" MODIFIED="1753366413237" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/ElegantTools$ElegantTools.coverage" NAME="ElegantTools Coverage Results" MODIFIED="1769421815378" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component>
</project>
+3
View File
@@ -68,6 +68,9 @@ class Model:
def loadSettingsGroup(self,group,fields,normalized=False):
for key in group.keys():
ele = self.om.getElement(key)
if ele is None:
print('Cannot find element',key)
continue
for field in fields:
ele.__dict__[field]=group[key][field]
if normalized:
+1 -1
View File
@@ -73,7 +73,7 @@ class Track(QtCore.QObject):
def Telegant(self):
self.parent.UITrackOutput.appendPlainText('Starting thread to run elegant')
#p = subprocess.run(self.cmd)
# p = subprocess.run(self.cmd)
p = subprocess.Popen(self.cmd,stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in iter(p.stdout.readline, b''):
self.message.emit(line.decode('utf-8').strip())
+1 -1
View File
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/ElegantPlotGui.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
# Created by: PyQt5 UI code generator 5.15.11
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
+2 -2
View File
@@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/ElegantToolsGui.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
# Created by: PyQt5 UI code generator 5.15.11
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
@@ -521,7 +521,7 @@ class Ui_ElegantGUI(object):
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(ElegantGUI)
self.TabMaster.setCurrentIndex(2)
self.TabMaster.setCurrentIndex(0)
self.actionQuit.triggered.connect(ElegantGUI.close) # type: ignore
QtCore.QMetaObject.connectSlotsByName(ElegantGUI)