Add Models.append() example
"cell_type": "markdown",
"metadata": {},
"source": [
- "And to see which models are available you can use the `.names` attribute:"
+ "**Note:**To make the access by name unambiguous, models are required to have a unique name, otherwise an error will be thrown.\n",
+ "\n",
+ "To see which models are available you can use the `.names` attribute:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "Note that a `SkyModel` object can be evaluated for a given longitude, latitude, and energy, but the `Models` object cannot. This `Models` container object will be assigned to `Dataset` or `Datasets` together with the data to be fitted as explained in other analysis tutotials (see for example the [modeling](modeling.ipynb) notebook).\n",
+ "Note that a `SkyModel` object can be evaluated for a given longitude, latitude, and energy, but the `Models` object cannot. This `Models` container object will be assigned to `Dataset` or `Datasets` together with the data to be fitted as explained in other analysis tutorials (see for example the [modeling](modeling.ipynb) notebook).\n",
"\n",
- "TODO: show `models.append` and `models.extend`"
+ "The `Models` class also has in place `.append()` and `.extend()` methods:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "model_copy = model.copy(name=\"my-source-copy\")\n",
+ "models.append(model_copy)"
]
},
{
