Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation pages #101

Merged
merged 31 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
36ae325
Clear readme
vmenger Jun 11, 2024
07107bd
Update readme
vmenger Jun 11, 2024
1a1b968
Add small summary
vmenger Jun 11, 2024
8414b70
Merge remote-tracking branch 'origin/main' into add-documentation-pages
vmenger Jun 11, 2024
beecc6e
Update create issue link
vmenger Jun 11, 2024
a7dbfbb
Add introduction page
vmenger Jun 13, 2024
a96bc4a
Add numbering
vmenger Jun 13, 2024
71a6318
Add markers for including in docs
vmenger Jun 13, 2024
089bff7
Add information how to create a component
vmenger Jun 13, 2024
1b977bf
Add information how to install
vmenger Jun 13, 2024
15a417b
Add getting started example
vmenger Jun 13, 2024
c252239
Typo
vmenger Jun 13, 2024
3752442
Update displacy doc render
vmenger Jun 13, 2024
265c689
Add citing info
vmenger Jun 13, 2024
3c08d74
Update roadmap docs page
vmenger Jun 13, 2024
b9bddb0
Update metrics doc page
vmenger Jun 13, 2024
e52690a
Restructure toc
vmenger Jun 13, 2024
18e246e
Add components library
vmenger Jun 13, 2024
806d45b
Add qualifiers definitions to docs
vmenger Jun 13, 2024
ddaa713
Fix admonitions
vmenger Jun 13, 2024
872843a
Fix broken links
vmenger Jun 13, 2024
9711d8a
Add pr template
vmenger Jun 17, 2024
c4d361e
Text editing improvements
vmenger Jun 17, 2024
3d9a96c
Small text edit
vmenger Jun 17, 2024
c49a1aa
Minor formatting updates
vmenger Jun 17, 2024
d8ce3a6
Textual changes from review
msnackey Jun 18, 2024
e2bcc84
Revert "Textual changes from review"
vmenger Jun 18, 2024
a78df9f
Open external links in new tab
vmenger Jun 18, 2024
8740457
Textual improvements
vmenger Jun 18, 2024
698d3b6
Add github repo link
vmenger Jun 18, 2024
ad81e77
Update pydantic
vmenger Jun 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/PR_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Pull Request
about: Create a pull request to make a change to the code
title: ''
labels: bug
assignees: ''

---

**Describe the change**
Please provide a clear and concise description and motivation of the proposed change.

**Linked issue**
If this pull request is related to an issue, please provide a link to the issue here.

**I have checked my changes are in line with the [Coding Standards](https://clinlp.readthedocs.io/en/latest/contributing.html#coding-standards)**
Yes/no

**I have added my changes to the `CHANGELOG.md` file**
Yes/no

**Any other relevant information**
Add any other context about the pull request here.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* :exclamation: `clinlp` now stores entities in `doc.spans['ents']` rather than `doc.ents`, allowing for overlap
* :exclamation: Overlap in entities found by the entity matcher is no longer resolved by default (replacing old behavior). To remove overlap, pass `resolve_overlap=True`.
* Refactored tests to use `pytest` best practices
* Changed `clinlp_autocomponent` to `clinlp_component`, which automatically registers your component with spaCy
* Changed `clinlp_autocomponent` to `clinlp_component`, which automatically registers your component with `spaCy`
* Codebase and linting improvements
* Renamed the `other_threshold` config to `family_threshold` in the `clinlp_experiencer_transformer` component

Expand Down Expand Up @@ -143,7 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Remove a default spacy abbreviation (`ts.`)
* Remove a default `spaCy` abbreviation (`ts.`)
* Option for max scope on qualifier rules, limiting the number of tokens it applies to
* A transformer based pipeline for negation detection (`clinlp_negation_transformer`)
* A base class `QualifierDetector` for qualifier detection
Expand Down
48 changes: 45 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Repository structure](#repository-structure)
- [Coding standards](#coding-standards)
- [General principles](#general-principles)
- [Creating a component](#creating-a-component)
- [Formatting and linting](#formatting-and-linting)
- [Dependencies](#dependencies)
- [Tests](#tests)
Expand All @@ -36,7 +37,7 @@ Please keep in mind that this page describes the ideal process and criteria for

Our preferred way of communication is through [issues](https://github.com/umcu/clinlp/issues), GitHubs built-in issue tracker. We use it for most communication, including questions, bug reports, feature requests, help getting started, etc. This way, the entire community can benefit from the discussion. If this is not an option, you can also reach out to us by e-mail: [[email protected]](mailto:[email protected]).

To create an issue right now, you can use the following link: [Create an issue](https://github.com/umcu/clinlp/issues/new).
To create an issue right now, you can use the following link: [Create an issue](https://github.com/umcu/clinlp/issues/new/choose).

We will try to respond to you as soon as possible. Please keep in mind that we are with a small group of maintainers, so we might not always be able to get back to you within a few days.

Expand Down Expand Up @@ -75,7 +76,7 @@ If you have a feature request that you would like someone to pick up, please inc

Keep in mind that a feature request might not be picked up immediately, or at all. We will try to keep the roadmap up to date, so you can see what is being worked on, and what is planned for the future. Furthermore, remember that `clinlp` is a collection of generic components that process clinical text written in Dutch. If the proposed addition does not meet those criteria, a separate release might be a better option. We typically also don't include preprocessing components (e.g. fixing encodings, de-identification, etc.), as those should preferably be handled at the source.

If you would like to contribute to the project yourself directly, it's recommended to [create an issue](https://github.com/umcu/clinlp/issues/new) to discuss your idea beforehand. This way, we can make sure that your contribution is in line with the project's goals and that it is not already being worked on by someone else. Of course, for small changes that only touch a couple of lines of code, you can also directly create a pull request. When you are ready to start working on your contribution, please follow the steps outlined in the [Pull requests](#pull-requests) section.
If you would like to contribute to the project yourself directly, it's recommended to [create an issue](https://github.com/umcu/clinlp/issues/new/choose) to discuss your idea beforehand. This way, we can make sure that your contribution is in line with the project's goals and that it is not already being worked on by someone else. Of course, for small changes that only touch a couple of lines of code, you can also directly create a pull request. When you are ready to start working on your contribution, please follow the steps outlined in the [Pull requests](#pull-requests) section.

## Pull requests

Expand Down Expand Up @@ -146,6 +147,47 @@ Please keep the following principles in mind when writing code:

We fully acknowledge that writing production ready code is a skill that takes time to develop. We are happy to work together, so please don't hesitate to reach out to us. This is especially true for scientific researchers who are working on something cool, but are new to software development.

### Creating a component

When creating a new component for `clinlp`, try to:

- Use a class to define the component, and use `__init__` to set the arguments.
- Inherit from `Pipe` to make it compatible with `spaCy`.
- Use the `clinlp_component` decorator, to automatically register it in the component library.
- Use a dictionary to define any defaults, and pass this to `default_config` of `clinlp_component`.
- Use type hints for all arguments and return values.
- Use the `requires` and `assigns` arguments to specify which fields the component needs, and which it sets.
- Implement the actual behavior of the component in the `__call__` method

The following code snippet shows an example of a new component:

```python
from clinlp.utils import clinlp_component
from spacy.language import Pipe
from spacy.tokens import Doc

_defaults = {
"arg_1": 1,
"arg_2": True
}

@clinlp_component(
name="my_new_component",
requires=["input_spacy_field"],
assigns=["output_spacy_field"],
default_config=_defaults
)

class MyNewComponent(Pipe):

def __init__(self, arg_1: Type = _defaults['arg_1'], arg_2: Type = _defaults['arg_2']):
...

def __call__(doc: Doc) -> Doc:
...
return doc
```

### Formatting and linting

We use `ruff` for both formatting and linting. It is configured in `pyproject.toml`.
vmenger marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -260,7 +302,7 @@ We use type hints throughout the codebase, for both functions and classes. This

### Documentation

We like our code to be well documented. The documentation can be found in the `docs` directory. If you are making changes to the codebase, please make sure to update the documentation accordingly.
We like our code to be well documented. The documentation can be found in the `docs` directory. If you are making changes to the codebase, please make sure to update the documentation accordingly. If you are adding new components, please add them to the [component library](https://clinlp.readthedocs.io/en/latest/components.html), and following the existing structure.
vmenger marked this conversation as resolved.
Show resolved Hide resolved

#### Docstrings

Expand Down
Loading
Loading