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

chore: bump version to 0.12.0 #296

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
# requites to grab the history of the PR
fetch-depth: 0
- uses: actions/setup-python@v4
with:
# cache: 'pip'
- uses: pre-commit/[email protected]
with:
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Check out our interactive [demo](https://aphp.github.io/edsnlp/demo/) !
You can install EDS-NLP via `pip`. We recommend pinning the library version in your projects, or use a strict package manager like [Poetry](https://python-poetry.org/).

```shell
pip install edsnlp==0.11.2
pip install edsnlp==0.12.0
```

or if you want to use the trainable components (using pytorch)

```shell
pip install "edsnlp[ml]==0.11.2"
pip install "edsnlp[ml]==0.12.0"
```

### A first pipeline
Expand Down
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

### Added

### Changed

### Fixed

## v0.12.0

### Added

- The `eds.transformer` component now accepts `prompts` (passed to its `preprocess` method, see breaking change below) to add before each window of text to embed.
- `LazyCollection.map` / `map_batches` now support generator functions as arguments.
- Window stride can now be disabled (i.e., stride = window) during training in the `eds.transformer` component by `training_stride = False`
Expand Down Expand Up @@ -55,7 +63,7 @@
```
- Trainable embedding components now all use `foldedtensor` to return embeddings, instead of returning a tensor of floats and a mask tensor.
- :boom: TorchComponent `__call__` no longer applies the end to end method, and instead calls the `forward` method directly, like all torch modules.
- The trainable `eds.span_qualifier` component has been renamed to `eds.span_classifier` to reflect its general gpurpose (it doesn't only predict qualifiers, but any attribute of a span using its context or not).
- The trainable `eds.span_qualifier` component has been renamed to `eds.span_classifier` to reflect its general purpose (it doesn't only predict qualifiers, but any attribute of a span using its context or not).
- `omop` converter now takes the `note_datetime` field into account by default when building a document
- `span._.date.to_datetime()` and `span._.date.to_duration()` now automatically take the `note_datetime` into account
- `nlp.vocab` is no longer serialized when saving a model, as it may contain sensitive information and can be recomputed during inference anyway
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Check out our interactive [demo](https://aphp.github.io/edsnlp/demo/) !
You can install EDS-NLP via `pip`. We recommend pinning the library version in your projects, or use a strict package manager like [Poetry](https://python-poetry.org/).

```{: data-md-color-scheme="slate" }
pip install edsnlp==0.11.2
pip install edsnlp==0.12.0
```

or if you want to use the trainable components (using pytorch)

```{: data-md-color-scheme="slate" }
pip install "edsnlp[ml]==0.11.2"
pip install "edsnlp[ml]==0.12.0"
```

### A first pipeline
Expand Down
2 changes: 1 addition & 1 deletion edsnlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import edsnlp.pipes
from . import reducers

__version__ = "0.11.2"
__version__ = "0.12.0"

BASE_DIR = Path(__file__).parent

Expand Down
2 changes: 1 addition & 1 deletion edsnlp/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ def load_from_huggingface(
if should_install or not any(
p.startswith(module_name) and p.endswith(".dist-info") for p in os.listdir(path)
):
pip = sys.executable.rsplit("/", 1)[0] + "/pip"
pip = os.path.join(*os.path.split(sys.executable)[:-1], "pip")
subprocess.run(
[pip, "install", path, "--target", path, "--no-deps", "--upgrade"]
)
Expand Down
6 changes: 5 additions & 1 deletion edsnlp/core/registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from weakref import WeakKeyDictionary

import catalogue
import importlib_metadata
import spacy
from confit import Config, Registry, RegistryCollection, set_default_registry
from confit.errors import ConfitValidationError, patch_errors
Expand All @@ -17,6 +16,11 @@
import edsnlp
from edsnlp.utils.collections import FrozenDict, FrozenList

try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata

PIPE_META = WeakKeyDictionary()


Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
os.environ["EDSNLP_MAX_CPU_WORKERS"] = "2"
os.environ["TZ"] = "Europe/Paris"

time.tzset()
try:
time.tzset()
except AttributeError:
pass
logging.basicConfig(level=logging.INFO)


Expand Down
Loading