Skip to content

Commit 95c0e78

Browse files
committed
Add doc
1 parent 4907eee commit 95c0e78

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ The best documentation to read about this project is located in Pharo Tree Sitte
6767

6868
You can find the documentation on some analysis possible here: [Analysis documentation](resources/doc/analysis.md).
6969

70+
You can find the documentation on exporting models with their derived properties (used by the Profile project) here: [Profile documentation](resources/doc/profile.md).
71+
72+
The export and import of a model are covered by parametric tests: the tests run both on the imported model and on the model exported and re-imported.
73+
7074

7175
## Control flow graph
7276

‎resources/doc/profile.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Profile documentation
2+
3+
This document describes the tools provided by the `FAST-Python-ExtraTools` package. These tools are used by the Profile project and are **not loaded by default**: to load them, load the `Profile` group of the baseline.
4+
5+
```smalltalk
6+
Metacello new
7+
githubUser: 'moosetechnology' project: 'FAST-Python' commitish: 'main' path: 'src';
8+
baseline: 'FASTPython';
9+
load: 'Profile'
10+
```
11+
12+
## Exporting a model with its derived properties
13+
14+
The `FMModelExporterWithDerived` is a special exporter that, contrary to the normal exporter, also exports the derived properties of the entities. This is useful to provide a model to people not using Moose.
15+
16+
To export a model with its derived properties, send `#exportAsJSONWithDerived` to the model:
17+
18+
```smalltalk
19+
model exportAsJSONWithDerived
20+
```
21+
22+
> Warning: this export is slower than a normal export because it computes all the caches of the model. Moreover, if a property fails to be computed, it is ignored and not exported.
23+
24+
### Excluding some properties
25+
26+
Some properties can be excluded from the export by giving a blacklist to `#exportAsJSONWithDerivedBlacklist:`. The blacklist should contain the compiled method names of the properties to exclude, in the form `Class>>#selector`:
27+
28+
```smalltalk
29+
model exportAsJSONWithDerivedBlacklist: #('TEntityMetaLevelDependency>>#isDead' 'TEntityMetaLevelDependency>>#fanIn' 'TEntityMetaLevelDependency>>#fanOut' 'TEntityMetaLevelDependency>>#numberOfDeadChildren' 'TEntityMetaLevelDependency>>#numberOfExternalClients' 'TEntityMetaLevelDependency>>#numberOfExternalProviders' 'TEntityMetaLevelDependency>>#numberOfInternalProviders' 'TEntityMetaLevelDependency>>#numberOfInternalClients')
30+
```
31+
32+
## Unique identifier
33+
34+
The package adds a `#uniqueIdentifier` property to all entities. This property is a UUID, generated the first time it is accessed and then cached. It is used because the Moose ID is not fixed: it can change between two imports of the same model, so the Profile project needs a stable identifier for its entities.

0 commit comments

Comments
 (0)