diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 000000000..994a46357 --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. +config: c9c19100d8ab1d5c1cd514173feef339 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/_images/2021-05-09_10-32.jpg b/_images/2021-05-09_10-32.jpg new file mode 100644 index 000000000..d16a02951 Binary files /dev/null and b/_images/2021-05-09_10-32.jpg differ diff --git a/_images/2021-05-09_10-36.jpg b/_images/2021-05-09_10-36.jpg new file mode 100644 index 000000000..db2876cb3 Binary files /dev/null and b/_images/2021-05-09_10-36.jpg differ diff --git a/_images/2021-05-09_10-50.jpg b/_images/2021-05-09_10-50.jpg new file mode 100644 index 000000000..cd12ca5d9 Binary files /dev/null and b/_images/2021-05-09_10-50.jpg differ diff --git a/_images/2021-05-09_17-36.jpg b/_images/2021-05-09_17-36.jpg new file mode 100644 index 000000000..b5581088b Binary files /dev/null and b/_images/2021-05-09_17-36.jpg differ diff --git a/_images/2021-05-09_17-38.jpg b/_images/2021-05-09_17-38.jpg new file mode 100644 index 000000000..60c056e85 Binary files /dev/null and b/_images/2021-05-09_17-38.jpg differ diff --git a/_images/2021-05-09_17-44.jpg b/_images/2021-05-09_17-44.jpg new file mode 100644 index 000000000..83b414d0f Binary files /dev/null and b/_images/2021-05-09_17-44.jpg differ diff --git a/_images/2021-05-09_17-57.jpg b/_images/2021-05-09_17-57.jpg new file mode 100644 index 000000000..b9dd0947e Binary files /dev/null and b/_images/2021-05-09_17-57.jpg differ diff --git a/_images/2021-05-09_21-21.jpg b/_images/2021-05-09_21-21.jpg new file mode 100644 index 000000000..1b27de5f0 Binary files /dev/null and b/_images/2021-05-09_21-21.jpg differ diff --git a/_images/2021-05-09_21-46.jpg b/_images/2021-05-09_21-46.jpg new file mode 100644 index 000000000..903bd8e92 Binary files /dev/null and b/_images/2021-05-09_21-46.jpg differ diff --git a/_images/2021-05-09_22-09.jpg b/_images/2021-05-09_22-09.jpg new file mode 100644 index 000000000..5b3a1fcd2 Binary files /dev/null and b/_images/2021-05-09_22-09.jpg differ diff --git a/_images/2021-05-09_22-39.jpg b/_images/2021-05-09_22-39.jpg new file mode 100644 index 000000000..d02b6668f Binary files /dev/null and b/_images/2021-05-09_22-39.jpg differ diff --git a/_images/2021-05-10_22-35.jpg b/_images/2021-05-10_22-35.jpg new file mode 100644 index 000000000..9c3650585 Binary files /dev/null and b/_images/2021-05-10_22-35.jpg differ diff --git a/_images/2021-05-10_22-59.jpg b/_images/2021-05-10_22-59.jpg new file mode 100644 index 000000000..ca184bc6c Binary files /dev/null and b/_images/2021-05-10_22-59.jpg differ diff --git a/_images/2021-05-12_18-18.jpg b/_images/2021-05-12_18-18.jpg new file mode 100644 index 000000000..5ee9dac5a Binary files /dev/null and b/_images/2021-05-12_18-18.jpg differ diff --git a/_images/2021-05-12_18-51.jpg b/_images/2021-05-12_18-51.jpg new file mode 100644 index 000000000..afb248858 Binary files /dev/null and b/_images/2021-05-12_18-51.jpg differ diff --git a/_images/2021-05-12_19-12.jpg b/_images/2021-05-12_19-12.jpg new file mode 100644 index 000000000..cda80cf9d Binary files /dev/null and b/_images/2021-05-12_19-12.jpg differ diff --git a/_images/2021-05-12_20-06.jpg b/_images/2021-05-12_20-06.jpg new file mode 100644 index 000000000..b34855edf Binary files /dev/null and b/_images/2021-05-12_20-06.jpg differ diff --git a/_images/2021-05-12_20-10.jpg b/_images/2021-05-12_20-10.jpg new file mode 100644 index 000000000..04d6402f1 Binary files /dev/null and b/_images/2021-05-12_20-10.jpg differ diff --git a/_images/2021-05-12_21-03.jpg b/_images/2021-05-12_21-03.jpg new file mode 100644 index 000000000..384e2ba0d Binary files /dev/null and b/_images/2021-05-12_21-03.jpg differ diff --git a/_images/2021-05-13_20-46.jpg b/_images/2021-05-13_20-46.jpg new file mode 100644 index 000000000..d3448b877 Binary files /dev/null and b/_images/2021-05-13_20-46.jpg differ diff --git a/_images/2021-05-17_11-50.jpg b/_images/2021-05-17_11-50.jpg new file mode 100644 index 000000000..3fb35b9c0 Binary files /dev/null and b/_images/2021-05-17_11-50.jpg differ diff --git a/_images/crosslayer_intro.jpg b/_images/crosslayer_intro.jpg new file mode 100644 index 000000000..41349a91a Binary files /dev/null and b/_images/crosslayer_intro.jpg differ diff --git a/_images/examples_01_Introduction_20_0.svg b/_images/examples_01_Introduction_20_0.svg new file mode 100644 index 000000000..a5f48acd3 --- /dev/null +++ b/_images/examples_01_Introduction_20_0.svg @@ -0,0 +1 @@ +LFHogwartsproduce GreatWizardsprotectStudentsagainst the...CampusSchooleducate WizardsWhomping Willowdefend thesurrounding areaagainst IntrudersProf. A. P. W. B.Dumbledoremanage theschooladvise HarryProf. S. SnapeTeachingmaintain alayer ofdefense fortheSorcerer'sStoneHarry J. Potterkill He WhoMust Not BeNamedR. Weasleyassist Harrybreak schoolruleswizardryHeadmasterResponsibilitiesTeacher...Help for HarryKnowledgePunishmentLearningeducate & maturefriendshipassistanceCarepunisheducate \ No newline at end of file diff --git a/_images/examples_02_Intro_to_Physical_Architecture_API_5_0.svg b/_images/examples_02_Intro_to_Physical_Architecture_API_5_0.svg new file mode 100644 index 000000000..1ddd0c940 --- /dev/null +++ b/_images/examples_02_Intro_to_Physical_Architecture_API_5_0.svg @@ -0,0 +1 @@ +VehicleEquipment compartmentServerCompute Card 1Card 1 OSCamera Driver SWCApp 1 SWCCooling FanX2...Compute Card 2Card 2 OSApp 2 SWCX2...Network SwitchSwitch FirmwareSwitch ConfigurationP1...P3...P2...Sensor compartmentCamera AssemblyCameraFirmwarecard1-...PL 1Eth Cable 2Eth Cable 3C 1C 2C 3C 4C 5C 6card1 - card2 connectionD 7D 8PL 1C 10 \ No newline at end of file diff --git a/_images/examples_05_Introduction_to_Libraries_9_0.svg b/_images/examples_05_Introduction_to_Libraries_9_0.svg new file mode 100644 index 000000000..3c76806f6 --- /dev/null +++ b/_images/examples_05_Introduction_to_Libraries_9_0.svg @@ -0,0 +1 @@ +LFE-Commerceoffer productsassign orderClientselect productget productTruck Companyreceive orderdeliver productproduct listsupply detailsorder details \ No newline at end of file diff --git a/_images/examples_07_Code_Generation_4_0.svg b/_images/examples_07_Code_Generation_4_0.svg new file mode 100644 index 000000000..b382dcb95 --- /dev/null +++ b/_images/examples_07_Code_Generation_4_0.svg @@ -0,0 +1 @@ +TrajectoryWaypointlat : floatlon : floatalt : floatExampletest : strfloatstr \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_11_0.svg b/_images/examples_09_Context_Diagrams_11_0.svg new file mode 100644 index 000000000..4c19f193e --- /dev/null +++ b/_images/examples_09_Context_Diagrams_11_0.svg @@ -0,0 +1 @@ +LFProf. S. SnapeTeachingHarry J. Potterkill He Who Must NotBe NamedHogwartsCampusSchooleducate Wizardseducateeducate & mature \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_1.svg b/_images/examples_09_Context_Diagrams_13_1.svg new file mode 100644 index 000000000..0f6638939 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_1.svg @@ -0,0 +1 @@ +OARoot Operational Activity \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_11.svg b/_images/examples_09_Context_Diagrams_13_11.svg new file mode 100644 index 000000000..db062b96f --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_11.svg @@ -0,0 +1 @@ +OAFunctional Human BeingHunt wild animalSearch for animalsMake FoodAnimal locationHunted animal \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_13.svg b/_images/examples_09_Context_Diagrams_13_13.svg new file mode 100644 index 000000000..f46dfd6ab --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_13.svg @@ -0,0 +1 @@ +OAFunctional Human BeingSearch for animalsHunt wild animalPredatorRun awaySpot itAnimal location \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_15.svg b/_images/examples_09_Context_Diagrams_13_15.svg new file mode 100644 index 000000000..eebe29e24 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_15.svg @@ -0,0 +1 @@ +OAFunctionalHuman BeingPlay games \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_17.svg b/_images/examples_09_Context_Diagrams_13_17.svg new file mode 100644 index 000000000..0fbd967af --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_17.svg @@ -0,0 +1 @@ +OAEnvironmentSpawn treeCreate landslideTree \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_19.svg b/_images/examples_09_Context_Diagrams_13_19.svg new file mode 100644 index 000000000..04c6a0c46 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_19.svg @@ -0,0 +1 @@ +OAEnvironmentCreate landslideSpawn treeWeatherSpawn waterFunctional HumanBeingBuild houseUnstable groundTreeWood \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_21.svg b/_images/examples_09_Context_Diagrams_13_21.svg new file mode 100644 index 000000000..aa34b9214 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_21.svg @@ -0,0 +1 @@ +OAEnvironmentCreate landslideWeatherSpawn waterUnstable ground \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_23.svg b/_images/examples_09_Context_Diagrams_13_23.svg new file mode 100644 index 000000000..cd4e4cc82 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_23.svg @@ -0,0 +1 @@ +OAEnvironmentCreate landslideFunctional HumanBeingBuild houseWood \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_25.svg b/_images/examples_09_Context_Diagrams_13_25.svg new file mode 100644 index 000000000..3448882f1 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_25.svg @@ -0,0 +1 @@ +OAPredatorRun awayFunctional Human BeingSearch for animalsSpot it \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_27.svg b/_images/examples_09_Context_Diagrams_13_27.svg new file mode 100644 index 000000000..d37e19790 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_27.svg @@ -0,0 +1 @@ +OAPredatorRepeatFunctionalHumanBeingSleepPreyKillStart againHunt \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_29.svg b/_images/examples_09_Context_Diagrams_13_29.svg new file mode 100644 index 000000000..922d78396 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_29.svg @@ -0,0 +1 @@ +OAPreyKillPredatorRepeatHunt \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_3.svg b/_images/examples_09_Context_Diagrams_13_3.svg new file mode 100644 index 000000000..d2158cd25 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_3.svg @@ -0,0 +1 @@ +OAFunctional Human BeingSleepEatPredatorRepeatStart againRest \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_5.svg b/_images/examples_09_Context_Diagrams_13_5.svg new file mode 100644 index 000000000..1ef4a8da3 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_5.svg @@ -0,0 +1 @@ +OAFunctional Human BeingEatMake FoodSleepMunchPrepared foodRest \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_7.svg b/_images/examples_09_Context_Diagrams_13_7.svg new file mode 100644 index 000000000..23286ba64 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_7.svg @@ -0,0 +1 @@ +OAEnvironmentSpawn wild animal \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_13_9.svg b/_images/examples_09_Context_Diagrams_13_9.svg new file mode 100644 index 000000000..ab72e452d --- /dev/null +++ b/_images/examples_09_Context_Diagrams_13_9.svg @@ -0,0 +1 @@ +OAFunctional Human BeingMake FoodHunt wild animalEatHunted animalPrepared food \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_1.svg b/_images/examples_09_Context_Diagrams_15_1.svg new file mode 100644 index 000000000..04871c688 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_1.svg @@ -0,0 +1 @@ +Stay aliveFunctional Human BeingEscape predatorsEat food \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_11.svg b/_images/examples_09_Context_Diagrams_15_11.svg new file mode 100644 index 000000000..b8c688c15 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_11.svg @@ -0,0 +1 @@ +Provide food sourcesProvide environment to live in \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_3.svg b/_images/examples_09_Context_Diagrams_15_3.svg new file mode 100644 index 000000000..fb77cc588 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_3.svg @@ -0,0 +1 @@ +Escape predatorsPreyPredatorFunctional Human BeingWeatherEntity 5Stay alive \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_5.svg b/_images/examples_09_Context_Diagrams_15_5.svg new file mode 100644 index 000000000..b4f2586e7 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_5.svg @@ -0,0 +1 @@ +Eat foodStay alive \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_7.svg b/_images/examples_09_Context_Diagrams_15_7.svg new file mode 100644 index 000000000..bca7e05e7 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_7.svg @@ -0,0 +1 @@ +Provide environment tolive inEnvironmentProvide food sources \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_15_9.svg b/_images/examples_09_Context_Diagrams_15_9.svg new file mode 100644 index 000000000..9ee491f3e --- /dev/null +++ b/_images/examples_09_Context_Diagrams_15_9.svg @@ -0,0 +1 @@ +Provide clean waterProvide environment to live in \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_6_0.svg b/_images/examples_09_Context_Diagrams_6_0.svg new file mode 100644 index 000000000..6b3c1eeba --- /dev/null +++ b/_images/examples_09_Context_Diagrams_6_0.svg @@ -0,0 +1 @@ +R. WeasleyHogwartsCampusWhomping WillowSchoolPunishmentCare \ No newline at end of file diff --git a/_images/examples_09_Context_Diagrams_8_0.svg b/_images/examples_09_Context_Diagrams_8_0.svg new file mode 100644 index 000000000..27203d752 --- /dev/null +++ b/_images/examples_09_Context_Diagrams_8_0.svg @@ -0,0 +1 @@ +LFWhomping Willowdefend thesurrounding areaagainst IntrudersR. Weasleybreak school rulesPunishmentpunish \ No newline at end of file diff --git a/_images/examples_10_Declarative_Modeling_12_0.svg b/_images/examples_10_Declarative_Modeling_12_0.svg new file mode 100644 index 000000000..b6a815214 --- /dev/null +++ b/_images/examples_10_Declarative_Modeling_12_0.svg @@ -0,0 +1 @@ +Coffee MachineUseruser interactions \ No newline at end of file diff --git a/_images/examples_11_Complexity_Assessment_2_0.svg b/_images/examples_11_Complexity_Assessment_2_0.svg new file mode 100644 index 000000000..27079911d --- /dev/null +++ b/_images/examples_11_Complexity_Assessment_2_0.svg @@ -0,0 +1,39 @@ + + + +180 +objects + + +31% + +16% + +27% + +27% + +18 +diagrams + + +39% + +22% + +28% + +11% + + + +Operational Analysis + +System Analysis + +Logical Architecture + +Physical Architecture + + + \ No newline at end of file diff --git a/_images/harrys_wand.png b/_images/harrys_wand.png new file mode 100644 index 000000000..effece64b Binary files /dev/null and b/_images/harrys_wand.png differ diff --git a/_images/waypoints.png b/_images/waypoints.png new file mode 100644 index 000000000..fd021c986 Binary files /dev/null and b/_images/waypoints.png differ diff --git a/_sources/code/capellambse.aird.rst.txt b/_sources/code/capellambse.aird.rst.txt new file mode 100644 index 000000000..1f1585a4a --- /dev/null +++ b/_sources/code/capellambse.aird.rst.txt @@ -0,0 +1,7 @@ +capellambse.aird package +======================== + +.. automodule:: capellambse.aird + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.diagram.rst.txt b/_sources/code/capellambse.diagram.rst.txt new file mode 100644 index 000000000..bf6ec497b --- /dev/null +++ b/_sources/code/capellambse.diagram.rst.txt @@ -0,0 +1,18 @@ +capellambse.diagram package +=========================== + +.. automodule:: capellambse.diagram + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.diagram.capstyle module +----------------------------------- + +.. automodule:: capellambse.diagram.capstyle + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.extensions.metrics.rst.txt b/_sources/code/capellambse.extensions.metrics.rst.txt new file mode 100644 index 000000000..a81d6a574 --- /dev/null +++ b/_sources/code/capellambse.extensions.metrics.rst.txt @@ -0,0 +1,26 @@ +capellambse.extensions.metrics package +====================================== + +.. automodule:: capellambse.extensions.metrics + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.extensions.metrics.collector module +----------------------------------------------- + +.. automodule:: capellambse.extensions.metrics.collector + :members: + :undoc-members: + :show-inheritance: + +capellambse.extensions.metrics.composer module +---------------------------------------------- + +.. automodule:: capellambse.extensions.metrics.composer + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.extensions.pvmt.rst.txt b/_sources/code/capellambse.extensions.pvmt.rst.txt new file mode 100644 index 000000000..a5b88bc87 --- /dev/null +++ b/_sources/code/capellambse.extensions.pvmt.rst.txt @@ -0,0 +1,7 @@ +capellambse.extensions.pvmt package +=================================== + +.. automodule:: capellambse.extensions.pvmt + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.extensions.reqif.rst.txt b/_sources/code/capellambse.extensions.reqif.rst.txt new file mode 100644 index 000000000..f9b4452e8 --- /dev/null +++ b/_sources/code/capellambse.extensions.reqif.rst.txt @@ -0,0 +1,18 @@ +capellambse.extensions.reqif package +==================================== + +.. automodule:: capellambse.extensions.reqif + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.extensions.reqif.exporter module +-------------------------------------------- + +.. automodule:: capellambse.extensions.reqif.exporter + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.extensions.rst.txt b/_sources/code/capellambse.extensions.rst.txt new file mode 100644 index 000000000..3e97e40c8 --- /dev/null +++ b/_sources/code/capellambse.extensions.rst.txt @@ -0,0 +1,29 @@ +capellambse.extensions package +============================== + +.. automodule:: capellambse.extensions + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + capellambse.extensions.metrics + capellambse.extensions.pvmt + capellambse.extensions.reqif + capellambse.extensions.validation + +Submodules +---------- + +capellambse.extensions.filtering module +--------------------------------------- + +.. automodule:: capellambse.extensions.filtering + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.extensions.validation.rst.txt b/_sources/code/capellambse.extensions.validation.rst.txt new file mode 100644 index 000000000..31adde34e --- /dev/null +++ b/_sources/code/capellambse.extensions.validation.rst.txt @@ -0,0 +1,18 @@ +capellambse.extensions.validation package +========================================= + +.. automodule:: capellambse.extensions.validation + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.extensions.validation.rules module +---------------------------------------------- + +.. automodule:: capellambse.extensions.validation.rules + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.filehandler.rst.txt b/_sources/code/capellambse.filehandler.rst.txt new file mode 100644 index 000000000..695066a24 --- /dev/null +++ b/_sources/code/capellambse.filehandler.rst.txt @@ -0,0 +1,74 @@ +capellambse.filehandler package +=============================== + +.. automodule:: capellambse.filehandler + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.filehandler.abc module +---------------------------------- + +.. automodule:: capellambse.filehandler.abc + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.git module +---------------------------------- + +.. automodule:: capellambse.filehandler.git + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.git\_askpass module +------------------------------------------- + +.. automodule:: capellambse.filehandler.git_askpass + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.gitlab\_artifacts module +------------------------------------------------ + +.. automodule:: capellambse.filehandler.gitlab_artifacts + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.http module +----------------------------------- + +.. automodule:: capellambse.filehandler.http + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.local module +------------------------------------ + +.. automodule:: capellambse.filehandler.local + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.memory module +------------------------------------- + +.. automodule:: capellambse.filehandler.memory + :members: + :undoc-members: + :show-inheritance: + +capellambse.filehandler.zip module +---------------------------------- + +.. automodule:: capellambse.filehandler.zip + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.loader.rst.txt b/_sources/code/capellambse.loader.rst.txt new file mode 100644 index 000000000..fee2c29ab --- /dev/null +++ b/_sources/code/capellambse.loader.rst.txt @@ -0,0 +1,34 @@ +capellambse.loader package +========================== + +.. automodule:: capellambse.loader + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.loader.core module +------------------------------ + +.. automodule:: capellambse.loader.core + :members: + :undoc-members: + :show-inheritance: + +capellambse.loader.exs module +----------------------------- + +.. automodule:: capellambse.loader.exs + :members: + :undoc-members: + :show-inheritance: + +capellambse.loader.modelinfo module +----------------------------------- + +.. automodule:: capellambse.loader.modelinfo + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.metamodel.information.rst.txt b/_sources/code/capellambse.metamodel.information.rst.txt new file mode 100644 index 000000000..1875b6af0 --- /dev/null +++ b/_sources/code/capellambse.metamodel.information.rst.txt @@ -0,0 +1,26 @@ +capellambse.metamodel.information package +========================================= + +.. automodule:: capellambse.metamodel.information + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.metamodel.information.datatype module +------------------------------------------------- + +.. automodule:: capellambse.metamodel.information.datatype + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.information.datavalue module +-------------------------------------------------- + +.. automodule:: capellambse.metamodel.information.datavalue + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.metamodel.rst.txt b/_sources/code/capellambse.metamodel.rst.txt new file mode 100644 index 000000000..3fe94be1e --- /dev/null +++ b/_sources/code/capellambse.metamodel.rst.txt @@ -0,0 +1,114 @@ +capellambse.metamodel package +============================= + +.. automodule:: capellambse.metamodel + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + capellambse.metamodel.information + +Submodules +---------- + +capellambse.metamodel.capellacommon module +------------------------------------------ + +.. automodule:: capellambse.metamodel.capellacommon + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.capellacore module +---------------------------------------- + +.. automodule:: capellambse.metamodel.capellacore + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.capellamodeller module +-------------------------------------------- + +.. automodule:: capellambse.metamodel.capellamodeller + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.cs module +------------------------------- + +.. automodule:: capellambse.metamodel.cs + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.fa module +------------------------------- + +.. automodule:: capellambse.metamodel.fa + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.interaction module +---------------------------------------- + +.. automodule:: capellambse.metamodel.interaction + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.la module +------------------------------- + +.. automodule:: capellambse.metamodel.la + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.modellingcore module +------------------------------------------ + +.. automodule:: capellambse.metamodel.modellingcore + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.modeltypes module +--------------------------------------- + +.. automodule:: capellambse.metamodel.modeltypes + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.oa module +------------------------------- + +.. automodule:: capellambse.metamodel.oa + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.pa module +------------------------------- + +.. automodule:: capellambse.metamodel.pa + :members: + :undoc-members: + :show-inheritance: + +capellambse.metamodel.sa module +------------------------------- + +.. automodule:: capellambse.metamodel.sa + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.model.rst.txt b/_sources/code/capellambse.model.rst.txt new file mode 100644 index 000000000..bfaf4cd63 --- /dev/null +++ b/_sources/code/capellambse.model.rst.txt @@ -0,0 +1,18 @@ +capellambse.model package +========================= + +.. automodule:: capellambse.model + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.model.diagram module +-------------------------------- + +.. automodule:: capellambse.model.diagram + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.rst.txt b/_sources/code/capellambse.rst.txt new file mode 100644 index 000000000..620699648 --- /dev/null +++ b/_sources/code/capellambse.rst.txt @@ -0,0 +1,58 @@ +capellambse package +=================== + +.. automodule:: capellambse + :no-index: + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + capellambse.aird + capellambse.diagram + capellambse.extensions + capellambse.filehandler + capellambse.loader + capellambse.metamodel + capellambse.model + capellambse.svg + +Submodules +---------- + +capellambse.cli\_helpers module +------------------------------- + +.. automodule:: capellambse.cli_helpers + :members: + :undoc-members: + :show-inheritance: + +capellambse.decl module +----------------------- + +.. automodule:: capellambse.decl + :members: + :undoc-members: + :show-inheritance: + +capellambse.diagram\_cache module +--------------------------------- + +.. automodule:: capellambse.diagram_cache + :members: + :undoc-members: + :show-inheritance: + +capellambse.helpers module +-------------------------- + +.. automodule:: capellambse.helpers + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/capellambse.svg.rst.txt b/_sources/code/capellambse.svg.rst.txt new file mode 100644 index 000000000..e8e2069f9 --- /dev/null +++ b/_sources/code/capellambse.svg.rst.txt @@ -0,0 +1,58 @@ +capellambse.svg package +======================= + +.. automodule:: capellambse.svg + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +capellambse.svg.decorations module +---------------------------------- + +.. automodule:: capellambse.svg.decorations + :members: + :undoc-members: + :show-inheritance: + +capellambse.svg.drawing module +------------------------------ + +.. automodule:: capellambse.svg.drawing + :members: + :undoc-members: + :show-inheritance: + +capellambse.svg.generate module +------------------------------- + +.. automodule:: capellambse.svg.generate + :members: + :undoc-members: + :show-inheritance: + +capellambse.svg.helpers module +------------------------------ + +.. automodule:: capellambse.svg.helpers + :members: + :undoc-members: + :show-inheritance: + +capellambse.svg.style module +---------------------------- + +.. automodule:: capellambse.svg.style + :members: + :undoc-members: + :show-inheritance: + +capellambse.svg.symbols module +------------------------------ + +.. automodule:: capellambse.svg.symbols + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/code/modules.rst.txt b/_sources/code/modules.rst.txt new file mode 100644 index 000000000..34442a353 --- /dev/null +++ b/_sources/code/modules.rst.txt @@ -0,0 +1,7 @@ +py-capellambse +============== + +.. toctree:: + :maxdepth: 4 + + capellambse diff --git a/_sources/development/developing-docs.rst.txt b/_sources/development/developing-docs.rst.txt new file mode 100644 index 000000000..1da7cba73 --- /dev/null +++ b/_sources/development/developing-docs.rst.txt @@ -0,0 +1,31 @@ +.. + SPDX-FileCopyrightText: Copyright DB InfraGO AG + SPDX-License-Identifier: Apache-2.0 + +************************* +Documentation development +************************* + +First, make sure that the necessary dependencies for building documentation are +installed: + +.. code:: bash + + pip install '.[docs]' + +The following command builds the documentation: + +.. code:: bash + + make -C docs html + +The resulting documentation build will be available in ``docs/build/html``. + +Instead, you can also use ``make -C docs serve`` to (re-)build the docs and start a +local server, which can be accessed on http://localhost:8000. + +The following command deletes previously built documentation: + +.. code:: bash + + make -C docs clean diff --git a/_sources/development/how-to-explore-capella-mm.rst.txt b/_sources/development/how-to-explore-capella-mm.rst.txt new file mode 100644 index 000000000..963cba880 --- /dev/null +++ b/_sources/development/how-to-explore-capella-mm.rst.txt @@ -0,0 +1,225 @@ +.. + SPDX-FileCopyrightText: Copyright DB InfraGO AG + SPDX-License-Identifier: Apache-2.0 + +********************************* +How to explore Capella meta-model +********************************* + +Initially the API design was mostly based on our understanding of XML files, +however we soon moved on into exploring the Capella meta-model. Here is a short +summary of how we do it. + +Getting the meta-model sources +############################## + +First of all we need to get the data - the most straight-forward way is to +clone the Capella source code: + +.. code-block:: bash + + mkdir capella-mm && cd capella-mm + git clone https://github.com/eclipse/capella.git + +As there are quite a few files we may want to discover the packages of interest +using ``find``: + +- ``find -name '*.ecore' -o -name '*.genmodel'`` lists all the ECore models and + Generation files and adds Generation viewpoint for related ecore +- ``find -name '*.odesign'`` lists all the Sirius definitions (if you like to + see how the diagram look-and-feel is defined) + +You could open all the related projects right where they are but I'd prefer to +have a clean sandbox. + +.. code-block:: bash + + mkdir capella-metamodel + cp -r capella/common/plugins/org.polarsys.capella.common.data.activity.gen capella-metamodel + cp -r capella/common/plugins/org.polarsys.capella.common.data.behavior.gen capella-metamodel + cp -r capella/common/plugins/org.polarsys.capella.common.data.core.gen capella-metamodel + cp -r capella/common/plugins/org.polarsys.capella.common.libraries.gen capella-metamodel + cp -r capella/common/plugins/org.polarsys.capella.common.re.gen capella-metamodel + cp -r capella/core/plugins/org.polarsys.capella.core.data.gen capella-metamodel + cp -r capella/releng/cdo/plugins/org.polarsys.kitalpha.emde.model.cdo capella-metamodel + cp -r capella/tests/plugins/org.polarsys.capella.test.diagram.layout.ju capella-metamodel + +Now we have all of the meta-model dependencies in one place and can open it as +a single Eclipse project. You could open those with any Eclipse that has EMF +(like the Modeling bundle) but I'd advise using `Capella Studio`__ (open the +link and search for "Studio") for the best experience - it is provisioned with +all the extras that help you visualize / review the meta-model. + +__ https://www.eclipse.org/capella/download.html + +.. image:: ../_static/img/2021-05-09_10-32.jpg +.. image:: ../_static/img/2021-05-09_10-36.jpg + +After import Eclipse may highlight some projects with error or warning sign - +that's fine, we'll let it go for now. + +Before we dive into visualizations, let's have a quick look around. The core of +Capella metamodel is provided by ``org.polarsys.capella.common.data.core.gen`` +project. There you'll find the definitions of the "Capella Layers" and the +enabling "EnginereengConcerns" components. For example, the ``SystemAnalysis`` +is provided by ``ContextArchitecture.ecore``. + +.. image:: ../_static/img/2021-05-09_10-50.jpg + +Even though the default tree-view (triggered by double-click on a ``.core``) is +already giving us something there are much better ways to review the models. +We'll talk about that in the `Visualizing ECores`_ chapter. But first we +should have a look into the package structure and interdependencies. + +Quick intro to package structure +################################ + +If you are unfamiliar with ECore you might be wondering what are those ECore +files anyways. We could say that they act as UML Packages. Every package +contains ontology elements (or UML Classes) and "local" element relationships +(Associations). The packages depend on each-other as elements frequently build +on top of each-other via Generalization relationship. Thats one of the best +things about Capella metamodel - it is defined by UML (or well, structural +subset, but still pretty cool)! + +So, from using Capella we know our model layers - Operational Analysis, System +Analysis, Logical Architecture, Physical Architecture and EPBS. We can locate +the corresponding ECores pretty quick, but what are all the other packages +about? To answer that question we should visualize the package dependency - the +quickest way to do so is to `create a new representation file`__. And after +that follow the steps in `create package dependency overview`__. The result may +look like what we have below: + +__ #create-new-representations-file +__ #package-dependency-overview + +.. image:: ../_static/img/2021-05-09_17-38.jpg + +And even though there are not too many packages in the meta-model, when we +visualize the inter-package dependency it may be a bit difficult to understand. +By the way, the figure above `is also available in SVG`__ - you can open it in +a new tab and zoom-in if you like or scroll down for a simplified one (but +opinionated). + +__ core-pkg-deps-raw.svg + +It almost feels like everything depends on everything but that isn't true +really. We could change perspective and look for the dependencies of an +end-user exposed package, such as Operational Analysis (oa). I'll use Papyrus +to visualize that: + +.. image:: ../_static/img/2021-05-09_17-44.jpg + +When we add all the Capella layers to that picture things get a bit more +interesting. I added some artificial grouping on top of the existing packages +that will help us later on - the artificial groups are: ``CapellaLayers`` - +packages that cover the layers we used to see in the tool; ``CrossLayer`` - +packages that define ontology and patterns that we see in almost every layer; +``Enablers`` - the low level ontology that enables every element. + +.. image:: ../_static/img/2021-05-09_21-21.jpg + +To make a further point on ``CrossLayer``, lets have a closer look at a +Function. We know that Functions are quite similar in how they look and feel +across Capella layers and have a lot in common with OperationalActivity. When +we open ``LogicalArchitecture.ecore`` we see it defines a ``LogicalFunction`` +as a specialization of ``AbstractFunction`` that comes from +``FunctionalAnalysis.ecore``. There is a very nice feature provided by the +`Ecore Tools`__ (that is also included in Capella Studio) - Class Inheritance +view (there is also a tiny `how-to use it below`__). We'll use that to +visualize the way the functions are made. + +__ https://www.eclipse.org/ecoretools/overview.html +__ # + +.. image:: ../_static/img/2021-05-09_22-09.jpg + +Just to be on a safe side I've done the above exercise for +``OperationalActivity``, ``SystemFunction``, ``LogicalFunction`` and +``PhysicalFunction`` - the inheritance tree is exactly the same. I've done this +check for a few other familiar ontology elements and got same result. I think +this gives a feeling for what the ``CrossLayer`` is about - to me that's the +place where most of the magic happens. And this is how the relationship between +the ``CapellaLayers`` and ``CrossLayer`` looks like when we de-noise it a bit: + +.. image:: ../_static/img/2021-05-09_22-39.jpg + +It's been a lengthy chain of thought and to finish on a hopefully useful +visualization - lets have a look at the Class contexts of some things that we +use most frequently + +Visualizations of some frequently used ontology elements +######################################################## + +Below you'll find some quick visualizations for frequently used ontology +elements, grouped by CrossLayer package + +Functional Analysis +******************* + +.. image:: ../_static/img/2021-05-10_22-35.jpg + +.. image:: ../_static/img/2021-05-17_11-50.jpg + +.. image:: ../_static/img/2021-05-10_22-59.jpg + +.. image:: ../_static/img/2021-05-12_21-03.jpg + +State Machines +************** + +.. image:: ../_static/img/2021-05-12_18-18.jpg + +.. image:: ../_static/img/2021-05-13_20-46.jpg + +The figure above is somewhat a "treasure map" to everything related to state +machines. It is made in a semi-automatic way with the help of ECore Tools and +ELK + +Composite Structure +******************* + +.. image:: ../_static/img/2021-05-12_20-10.jpg + +.. image:: ../_static/img/2021-05-12_18-51.jpg + +You may also want to have a look at the Block context below as it defines some +other useful things that a Component (or LogicalComponent) can do. + +.. image:: ../_static/img/2021-05-12_20-06.jpg + +.. image:: ../_static/img/2021-05-12_19-12.jpg + +.. _Visualizing ECores: + +Appendix: Visualizing ECores +############################ + +If you are new to CapellaStudio and Ecore, here are some practical hints for +how to get stuff done, ignore the below otherwise: + +Create new representations file +******************************* + +To start playing with visualizations we need a new representations file +(.aird). It is pretty easy to get there but just in case, there is figure below +to guide you through that. + +.. image:: ../_static/img/2021-05-09_17-36.jpg + +Package dependency overview +*************************** + +To create a package dependency overview for all packages you may follow the +guidance in the figure below: + +.. image:: ../_static/img/2021-05-09_17-57.jpg + +Visualizing class inheritance +***************************** + +There is a very nice feature that allows given a class to show all of its +super-classes (generalizations) and specializations. The figure below gives you +some hints for how to use it: + +.. image:: ../_static/img/2021-05-09_21-46.jpg diff --git a/_sources/development/low-level-api.rst.txt b/_sources/development/low-level-api.rst.txt new file mode 100644 index 000000000..0b01fc56d --- /dev/null +++ b/_sources/development/low-level-api.rst.txt @@ -0,0 +1,307 @@ +.. + SPDX-FileCopyrightText: Copyright DB InfraGO AG + SPDX-License-Identifier: Apache-2.0 + +************* +Low-level API +************* + +.. py:currentmodule:: capellambse.loader.core + +The high level :py:class:`~capellambse.model.MelodyModel`-based API is largely +manually designed, and therefore sometimes does not cover all interesting +objects to a usable level. While we are constantly working on improving the +situation, it's also possible to use the low-level API based directly on the +XML files in order to temporarily work around these shortcomings. This +documentation sheds some light on the inner workings of this low-level API. + +In order to effectively work with it, you need to understand the basics of XML. +It also helps to be familiar with LXML_, which is used to parse and manipulate +the XML trees in memory. + +Unfortunately it's not possible to use LXML's built-in XML serializer. It +produces different whitespace in the XML tree, which confuses Capella's XML +diff-merge algorithm. This is why |project| ships with a custom serializer that +produces the same output format as Capella. It resides in the +:py:mod:`capellambse.loader.exs` module. + +.. _LXML: https://lxml.de/ + +The MelodyLoader object +======================= + +While the main object of interest for the high-level API is the +:py:class:`capellambse.model.MelodyModel` class, for the low-level API it is +the :py:class:`capellambse.loader.core.MelodyLoader`. It offers numerous +methods to search elements, resolve references, ensure model integrity during +certain modifications, and many more. + +The following sections categorize and document the various methods. + +The ``MelodyLoader`` closely works together with its auxiliary class +:py:class:`~capellambse.loader.core.ModelFile`. However, the ``ModelFile`` +mainly plays a role while loading or saving a model from/to disk (or other data +stores), and isn't used much when interacting with an already loaded model. + +.. _api-level-shift: + +Shifting between API levels +=========================== + +High to low-level shift +----------------------- + +Every model object (i.e. instance of ``ModelElement`` or one of its subclasses) +has an attribute ``_element``, which holds a reference to the corresponding +:py:class:`lxml.etree._Element` instance. The low-level API works directly with +these ``_Element`` instances. + +The ``MelodyModel`` object stores a reference to the +:py:class:`~capellambse.loader.core.MelodyLoader` instance. + +Low to high-level shift +----------------------- + +The ModelElement class offers the +:py:meth:`~capellambse.model.ModelElement.from_model` class method, which takes +a ``MelodyModel`` instance and a low-level LXML ``_Element`` as arguments and +constructs a high-level API proxy object from them. This is the way "back up" +to the high-level API. + +.. note:: + + Always call ``from_model`` on the base ``ModelElement`` class, not on its + subclasses. The base class automatically searches for the correct subclass + to instantiate, based on the ``xsi:type`` of the passed XML element. Calling + the method on a subclass directly may inadvertently cause the wrong class to + be picked. + +.. code-block:: python + + >>> myfunc = model.search("LogicalFunction")[0] + >>> el = myfunc._element + >>> el + + >>> from capellambse.model import ModelElement + >>> high_el = ModelElement.from_model(model, el) + >>> high_el == myfunc + True + +When working with multiple objects, it can be desirable to directly construct a +high-level :py:class:`~capellambse.model.ElementList` with them. The +ElementList constructor works similar to ``ModelElement.from_model``, but it +takes a list of elements instead of only a single one. + +.. code-block:: python + + >>> mycomp = model.search("LogicalComponent")[0] + >>> children = mycomp._element.getchildren() + >>> len(children) + 7 + >>> mylist = ElementList(model, children) + >>> mylist + [0] + [1] + [2] + [3] + [4] + [5] + [6] + +Moving along the XML tree +========================= + +In most simple cases, you can use the standard LXML methods in order to select +parent, child and sibling elements. + +.. code-block:: python + + >>> myfunc = model.search("LogicalFunction")[3] + >>> myfunc._element.getparent() + + >>> myfunc._element.getchildren() + [] + >>> myfunc._element.getprevious() + + >>> myfunc._element.getnext() + + +These elements and lists of elements can then be fed into +``ModelElement.from_model`` or the ``ElementList`` constructor respectively in +order to :ref:`return to the high-level API `. + +Capella models support fragmentation into multiple files, which results in +multiple XML trees being loaded into memory. This makes it difficult to +traverse up and down the hierarchy, because in theory every element can be a +fragment boundary – in this case, it does not have a physical parent element, +and ``getparent()`` will return ``None``. A call to ``getchildren()`` or +similar on the (logical) parent element will yield a placeholder which only +contains a reference to the real element, but does not hold any other +information. + +``MelodyLoader`` provides methods to traverse upwards or downwards in the +model's XML tree, while also taking into account fragment boundaries and the +aforementioned placeholder elements. + +.. class:: MelodyLoader + :noindex: + + .. automethod:: iterancestors + :noindex: + .. automethod:: iterchildren_xt + :noindex: + .. automethod:: iterdescendants + :noindex: + .. automethod:: iterdescendants_xt + :noindex: + +Resolving references +==================== + +You will often encounter attributes that contain references to other elements. + +The ``MelodyLoader`` provides the following methods to work with references: + +.. class:: MelodyLoader + :noindex: + + .. automethod:: follow_link + :noindex: + .. automethod:: follow_links + :noindex: + .. automethod:: create_link + :noindex: + +Finding elements elsewhere +========================== + +The low-level API implements the fundamentals for looking up model objects or +finding them by their type. The following methods are involved in these +operations: + +.. class:: MelodyLoader + :noindex: + + .. automethod:: iterall + :noindex: + .. automethod:: iterall_xt + :noindex: + .. automethod:: xpath + :noindex: + .. automethod:: xpath2 + :noindex: + +Manipulating objects +==================== + +.. warning:: + + The low-level API by itself does not do any consistency or validity checks + when modifying a model. Therefore it is very easy to break a model using it, + which can be very hard to recover from. Proceed with caution. + +As ``ModelElement`` instances are simply wrappers around the raw XML elements, +any changes to their attributes are directly reflected by changes to the +attributes or children of the underlying XML element and vice versa. This means +that no special care needs to be taken to keep the high-level and low-level +parts of the API synchronized. + +In many cases, the attribute names of the high-level API match those in the +XML, with the difference that the former uses ``snake_case`` naming (as is +conventional in the Python world), while the latter uses ``camelCase`` naming. +This example shows how the name of a function is accessed and modified using +the low-level API: + +.. code-block:: python + + >>> myfunc = model.search("LogicalFunction")[3] + >>> myfunc.name + 'defend the surrounding area against Intruders' + >>> myfunc._element.attrib["name"] + 'defend the surrounding area against Intruders' + >>> myfunc._element.attrib["name"] = "My Function" + >>> myfunc.name + 'My Function' + +Be aware that the XML usually does not explicitly store attributes that are set +to their default value (as defined by the meta model). In addition to that, the +high-level API often offers convenience shortcuts and reverse lookups that are +not directly reflected by XML attributes. Without at the detailed definitions, +it can therefore be difficult to infer the correct attributes for the low-level +API objects. + +Creating and deleting objects +============================= + +.. warning:: + + Creating or deleting objects through the low-level API is highly + discouraged, as it bears a very high risk of breaking the model. It's + unlikely that we can support you with any breakage that you encounter as a + result of using the low-level API. + + If you need access to model elements and relations that are not yet covered + by our high-level API, please consider contributing and extending it instead + – it's probably easier anyway. ;) + +The ID cache +------------ + +In order to provide instantaneous access to any model element via its UUID, the +MelodyLoader maintains a hashmap containing all UUIDs. This hashmap needs to be +updated when inserting or removing elements in the tree. The following methods +take care of that: + +.. class:: MelodyLoader + :noindex: + + .. automethod:: idcache_index + :noindex: + .. automethod:: idcache_remove + :noindex: + .. automethod:: idcache_rebuild + :noindex: + +Creating objects +---------------- + +Creating a new object with the low-level API is a rather complex process. The +``MelodyLoader`` does provide some basic integrity checks, but most of the +meta-model-aware logic is implemented within the high-level API. + +Before creating a new object, you need to generate and reserve a UUID for it. +This is done using the ``generate_uuid`` method. ``new_uuid`` provides a +context manager around it, which automatically cleans up the model in case +anything went wrong. It also checks that the UUID was properly registered with +the ID cache (see below). It is therefore highly recommended to use +``new_uuid`` over directly calling ``generate_uuid``. Note that even when using +``new_uuid``, you still need to manually call ``idcache_index`` on the newly +inserted element. + +.. class:: MelodyLoader + :noindex: + + .. automethod:: generate_uuid + :noindex: + .. automethod:: new_uuid + :noindex: + +Deleting objects +---------------- + +Inversely to creating new ones, when deleting an object from the XML tree it +also needs to be removed from the ID cache. This is done by calling +``idcache_remove`` (see above) on the element to be removed. Afterwards, delete +the element from its parent using the standard LXML API. + +Saving modifications +==================== + +The ``MelodyLoader`` provides the same ``save()`` method as the high-level +``MelodyModel``. + +.. class:: MelodyLoader + :noindex: + + .. automethod:: save + :noindex: diff --git a/_sources/development/repl.rst.txt b/_sources/development/repl.rst.txt new file mode 100644 index 000000000..e9ad7c89a --- /dev/null +++ b/_sources/development/repl.rst.txt @@ -0,0 +1,16 @@ +.. + SPDX-FileCopyrightText: Copyright DB InfraGO AG + SPDX-License-Identifier: Apache-2.0 + +The |project| REPL +================== + +.. automodule:: capellambse.repl + +.. sphinx_argparse_cli:: + :module: capellambse.repl + :func: main + :hook: + :prog: capellambse/repl.py + :title: Capellambse Repl + :group_title_prefix: diff --git a/_sources/examples/01 Introduction.ipynb.txt b/_sources/examples/01 Introduction.ipynb.txt new file mode 100644 index 000000000..9067671e8 --- /dev/null +++ b/_sources/examples/01 Introduction.ipynb.txt @@ -0,0 +1,675 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "1a1fe414", + "metadata": {}, + "source": [ + "# Introduction\n", + "\n", + "Welcome to the py-capella-mbse Showcase notebook. This notebook will show you some basic (and not so basic) things that you can get done using this library. For more advanced features have a look around the nearby notebooks.\n", + "\n", + "The below code loads the library and one of the test models:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "3e28d1c9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import capellambse\n", + "\n", + "path_to_model = \"../../../tests/data/melodymodel/5_0/Melody Model Test.aird\"\n", + "model = capellambse.MelodyModel(path_to_model)\n", + "model" + ] + }, + { + "cell_type": "markdown", + "id": "48ce0c1e", + "metadata": {}, + "source": [ + "Let's go to the first practical example of working with the library!" + ] + }, + { + "cell_type": "markdown", + "id": "7e68b88c-b4bc-4c20-a39f-48094c0eabdd", + "metadata": { + "tags": [] + }, + "source": [ + "## Example 1: Actor functions\n", + "\n", + "The below code will print every Actor available in the Logical Architecture layer" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "abcd8693", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Prof. A. P. W. B. Dumbledore\n", + "Prof. S. Snape\n", + "Harry J. Potter\n", + "R. Weasley\n", + "Voldemort\n", + "Multiport\n" + ] + } + ], + "source": [ + "for actor in model.la.all_actors:\n", + " print(actor.name)" + ] + }, + { + "cell_type": "markdown", + "id": "4ddbf9be", + "metadata": {}, + "source": [ + "but we could also \"zoom-in\" to an actor of interest:" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "56bb4b44", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/html": [ + "

\"\" Prof. S. Snape (org.polarsys.capella.core.data.la:LogicalComponent)

allocated_functions
  1. \"LogicalFunction\" "Teaching" (a7acb298-d14b-4707-a419-fea272434541)
  2. \"LogicalFunction\" "maintain a layer of defense for the Sorcerer's Stone" (4a2a7f3c-d223-4d44-94a7-50dd2906a70c)
applied_property_value_groups
  1. PropertyValueGroup "DarkMagic.Power" (2a480409-57d1-46f8-a0ce-e574706a9a7c)
  2. PropertyValueGroup "DarkMagic.Power Level" (b1d7453b-69ab-4d81-ab8b-1e48b5870340)
applied_property_values

(Empty list)

components

(Empty list)

constraints

(Empty list)

context_diagramContext of Prof. S. Snape (uuid: 6f463eed-c77b-4568-8078-beec0536f243_context)
description

Good guy and teacher of brewing arts.

\n", + "
diagrams

(Empty list)

exchanges

(Empty list)

filtering_criteria

(Empty list)

is_abstractFalse
is_actorTrue
is_humanTrue
layerLogicalArchitecture "Logical Architecture" (853cb005-cba0-489b-8fe3-bb694ad4543b)
nameProf. S. Snape
ownerLogicalComponentPkg "Structure" (84c0978d-9a32-4f5b-8013-5b0b6adbfd73)
parentLogicalComponentPkg "Structure" (84c0978d-9a32-4f5b-8013-5b0b6adbfd73)
partsBackreference to Part - omitted: can be slow to compute. Display this property directly to show.
physical_links

(Empty list)

physical_paths

(Empty list)

physical_ports

(Empty list)

ports
  1. ComponentPort "CP 1" (b4e39757-b0fd-41ff-a7b8-c9fc36de2ca9)
progress_statusNOT_SET
property_value_groups
  1. PropertyValueGroup "DarkMagic.Power" (2a480409-57d1-46f8-a0ce-e574706a9a7c)
  2. PropertyValueGroup "DarkMagic.Power Level" (b1d7453b-69ab-4d81-ab8b-1e48b5870340)
property_value_packages

(Empty list)

property_values

(Empty list)

pvmtProperty Value Management for \"LogicalComponent\" "Prof. S. Snape" (6f463eed-c77b-4568-8078-beec0536f243)
realization_viewRealization view of Prof. S. Snape (uuid: 6f463eed-c77b-4568-8078-beec0536f243_realization_view)
realized_components

(Empty list)

realized_system_components

(Empty list)

realizing_componentsBackreference to - omitted: can be slow to compute. Display this property directly to show.
realizing_physical_componentsBackreference to PhysicalComponent - omitted: can be slow to compute. Display this property directly to show.
related_exchangesBackreference to ComponentExchange - omitted: can be slow to compute. Display this property directly to show.
requirements

(Empty list)

sid
state_machines

(Empty list)

summary
traces

(Empty list)

uuid6f463eed-c77b-4568-8078-beec0536f243
validation<capellambse.extensions.validation._validate.ElementValidation object at 0x7118b7385400>
visible_on_diagrams
  1. [LAB] Wizzard Education (uuid: _dr0dQLB8EeqLtsTDMgEHBw)
  2. [LAB] Hidden Wizzard Education (uuid: _I0wRYOQUEe2jpIKbeHI0hw)
xtypeorg.polarsys.capella.core.data.la:LogicalComponent
" + ], + "text/plain": [ + "\n", + ".allocated_functions = [0] \n", + " [1] \n", + ".applied_property_value_groups = [0] \n", + " [1] \n", + ".applied_property_values = []\n", + ".components = []\n", + ".constraints = []\n", + ".context_diagram = \n", + ".description = Markup('

Good guy and teacher of brewing arts.

\\n')\n", + ".diagrams = []\n", + ".exchanges = []\n", + ".filtering_criteria = []\n", + ".is_abstract = False\n", + ".is_actor = True\n", + ".is_human = True\n", + ".layer = \n", + ".name = 'Prof. S. Snape'\n", + ".owner = \n", + ".parent = \n", + ".parts = ... # backreference to Part - omitted: can be slow to compute\n", + ".physical_links = []\n", + ".physical_paths = []\n", + ".physical_ports = []\n", + ".ports = [0] \n", + ".progress_status = 'NOT_SET'\n", + ".property_value_groups = [0] \n", + " [1] \n", + ".property_value_packages = []\n", + ".property_values = []\n", + ".pvmt = >\n", + ".realization_view = \n", + ".realized_components = []\n", + ".realized_system_components = []\n", + ".realizing_components = ... # backreference to - omitted: can be slow to compute\n", + ".realizing_physical_components = ... # backreference to PhysicalComponent - omitted: can be slow to compute\n", + ".related_exchanges = ... # backreference to ComponentExchange - omitted: can be slow to compute\n", + ".requirements = []\n", + ".sid = ''\n", + ".state_machines = []\n", + ".summary = ''\n", + ".traces = []\n", + ".uuid = '6f463eed-c77b-4568-8078-beec0536f243'\n", + ".validation = \n", + ".visible_on_diagrams = [0] \n", + " [1]