Skip to content

Commit

Permalink
Merge pull request #28 from bbglab/27-openvariant--failing-with-pytho…
Browse files Browse the repository at this point in the history
…n-313

Openvariant | Failing with Python 3.13
  • Loading branch information
dmartmillan authored Nov 22, 2024
2 parents 569982a + 51e6c63 commit 3eb92cb
Show file tree
Hide file tree
Showing 11 changed files with 469 additions and 481 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/openvariant_tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up the latest Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,14 @@ For more details check our [Installation](https://openvariant.readthedocs.io/en/

## Examples

We offer a bunch of [examples](https://github.com/bbglab/openvariant/tree/master/examples) to be able to understand how OpenVariant can be applied. Also, check
[Examples](https://openvariant.readthedocs.io/en/latest/examples.html) section in OpenVariant's documentation.
We provide a variety of [examples](https://github.com/bbglab/openvariant/tree/master/examples) to help to understand how OpenVariant can be applied. Explore the
[Examples](https://openvariant.readthedocs.io/en/latest/examples.html) section in OpenVariant's documentation for more details.

## Contributing

Feel free to contribute as much as you want to the code.
You're welcome to contribute to the code as much as you'd like!

See [CONTRIBUTING](https://github.com/bbglab/openvariant/blob/master/CONTRIBUTING.md) for guidelines on contributing and respect your behaviour specified
at [CODE OF CONDUCT](https://github.com/bbglab/openvariant/blob/master/CODE_OF_CONDUCT.md).
Please review the guidelines outlined in the [Contributing](https://github.com/bbglab/openvariant/blob/master/CONTRIBUTING.md) document and adhere to the standards of conduct detailed in the [Code of Conduct](https://github.com/bbglab/openvariant/blob/master/CODE_OF_CONDUCT.md).

## License

Expand Down
23 changes: 0 additions & 23 deletions main.py

This file was deleted.

16 changes: 13 additions & 3 deletions openvariant/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import pkg_resources
from multiprocessing import set_start_method

from openvariant.annotation.annotation import Annotation
from openvariant.tasks import cat, count, group_by
from openvariant.variant import Variant
from openvariant.find_files import findfiles

version = pkg_resources.require("open-variant")[0].version
__version__ = version
try:
from importlib.metadata import version # Python 3.8+
except ImportError:
from importlib_metadata import version # Backport for older versions

__version__ = version("open-variant")

# Set multiprocessing start method to 'spawn'
try:
set_start_method('spawn', force=True)
except RuntimeError:
pass

__all__ = ['Annotation', 'Variant', 'cat', 'count', 'group_by', 'findfiles']

9 changes: 7 additions & 2 deletions openvariant/annotation/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List
from yaml import safe_load, YAMLError

from openvariant.annotation.builder import AnnotationTypesBuilders
from openvariant.utils.utils import import_class_from_module
from openvariant.annotation.config_annotation import (AnnotationGeneralKeys, AnnotationKeys, AnnotationTypes,
ExcludesKeys, DEFAULT_FORMAT, DEFAULT_DELIMITER,
AnnotationFormat, AnnotationDelimiter)
Expand Down Expand Up @@ -166,8 +166,13 @@ def __init__(self, annotation_path: str) -> None:
self._annotations: dict = {}
for k in raw_annotation.get(AnnotationGeneralKeys.ANNOTATION.value, []):

class_name = k[AnnotationKeys.TYPE.value].upper()
module_name = "openvariant.annotation.builder"
ClassAnnotation = import_class_from_module(module_name, class_name)
instance = ClassAnnotation()

self._annotations[k[AnnotationKeys.FIELD.value]] = \
AnnotationTypesBuilders[k[AnnotationKeys.TYPE.value].upper()].value(k, self._path)
instance(k, self._path)

self._columns = raw_annotation.get(AnnotationGeneralKeys.COLUMNS.value, list(self.annotations.keys()))
self._check_columns()
Expand Down
Loading

0 comments on commit 3eb92cb

Please sign in to comment.