Skip to content

Commit

Permalink
Merge pull request #2808 from nf-core/update-api-docs-dev
Browse files Browse the repository at this point in the history
Update nf-core/tools API docs for dev
  • Loading branch information
mashehu authored Oct 25, 2024
2 parents ff40390 + b2c5673 commit 2049e2d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Find specified revision / branch hash

Loop through container names and download Singularity images

#### `prioritize_direct_download(container_list){:python}`
#### `prioritize_direct_download(container_list: List[str]) → List[str]{:python}`

Helper function that takes a list of container images (URLs and Docker URIs),
eliminates all Docker URIs for which also a URL is contained and returns the
Expand All @@ -151,6 +151,12 @@ we want to keep it and not replace with with whatever we have now (which might b

A regex that matches http, r”^$|^http” could thus be used to prioritize the Docker URIs over http Downloads

We also need to handle a special case: The <https://> Singularity downloads from Seqera Containers all end in ‘data’, although
they are not equivalent, e.g.:

<https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/63/6397750e9730a3fbcc5b4c43f14bd141c64c723fd7dad80e47921a68a7c3cd21/data>
<https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/c2/c262fc09eca59edb5a724080eeceb00fb06396f510aefb229c2d2c6897e63975/data>

#### `prompt_compression_type(){:python}`

Ask user if we should compress the downloaded files
Expand Down
51 changes: 42 additions & 9 deletions sites/docs/src/content/api_reference/dev/api/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,20 @@ Bases: `BaseModel`
"type": "object",
"properties": {
"repository_type": {
"title": "Repository Type",
"type": "string"
"anyOf": [
{
"enum": [
"pipeline",
"modules"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Repository Type"
},
"nf_core_version": {
"anyOf": [
Expand Down Expand Up @@ -501,10 +513,7 @@ Bases: `BaseModel`
"title": "NFCoreTemplateConfig",
"type": "object"
}
},
"required": [
"repository_type"
]
}
}
```

Expand All @@ -514,7 +523,7 @@ Bases: `BaseModel`
- [`lint (Dict[str, List[str] | List[Dict[str, List[str]]] | bool] | None)`](#nf_core.utils.NFCoreYamlConfig.lint)
- [`nf_core_version (str | None)`](#nf_core.utils.NFCoreYamlConfig.nf_core_version)
- [`org_path (str | None)`](#nf_core.utils.NFCoreYamlConfig.org_path)
- [`repository_type (str)`](#nf_core.utils.NFCoreYamlConfig.repository_type)
- [`repository_type (Literal['pipeline', 'modules'] | None)`](#nf_core.utils.NFCoreYamlConfig.repository_type)
- [`template (nf_core.utils.NFCoreTemplateConfig | None)`](#nf_core.utils.NFCoreYamlConfig.template)
- [`update (Dict[str, str | bool | Dict[str, str | Dict[str, str | bool]]] | None)`](#nf_core.utils.NFCoreYamlConfig.update)

Expand All @@ -534,9 +543,9 @@ Version of nf-core/tools used to create/update the pipeline

Path to the organisation’s modules repository (used for modules repo_type only)

#### _`field{:python}`_`repository_type{:python}`_: str_`{:python}`_\[Required]_
#### _`field{:python}`_`repository_type{:python}`_: Literal\['pipeline', 'modules'] | None_`{:python}`_= None_

Type of repository: pipeline or modules
Type of repository

#### _`field{:python}`_`template{:python}`_: [NFCoreTemplateConfig](#nf_core.utils.NFCoreTemplateConfig) | None_`{:python}`_= None_

Expand All @@ -548,6 +557,30 @@ Disable updating specific modules/subworkflows (when repository_type is pipeline

#### `get(item: str, default: Any = None) → Any{:python}`

#### `model_dump(**kwargs) → Dict[str, Any]{:python}`

Usage docs: <https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump>

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

- **Parameters:**
- **mode** – The mode in which to_python should run.
If mode is ‘json’, the output will only contain JSON serializable types.
If mode is ‘python’, the output may contain non-JSON-serializable Python objects.
- **include** – A set of fields to include in the output.
- **exclude** – A set of fields to exclude from the output.
- **context** – Additional context to pass to the serializer.
- **by_alias** – Whether to use the field’s alias in the dictionary key if defined.
- **exclude_unset** – Whether to exclude fields that have not been explicitly set.
- **exclude_defaults** – Whether to exclude fields that are set to their default value.
- **exclude_none** – Whether to exclude fields that have a value of None.
- **round_trip** – If True, dumped values should be valid as input for non-idempotent types such as Json\[T].
- **warnings** – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors,
“error” raises a \[PydanticSerializationError]\[pydantic_core.PydanticSerializationError].
- **serialize_as_any** – Whether to serialize fields with duck-typing serialization behavior.
- **Returns:**
A dictionary representation of the model.

#### `_abc_impl{:python}`_= <\_abc.\_abc_data object>_

### _`class{:python}`_`nf_core.utils.Pipeline(wf_path: Path){:python}`
Expand Down

0 comments on commit 2049e2d

Please sign in to comment.