Skip to content

Commit 70705bb

Browse files
authored
Merge pull request #98 from cropsinsilico/topic/cropps
Topic/cropps
2 parents 270e65a + 9df8362 commit 70705bb

File tree

107 files changed

+5845
-1373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+5845
-1373
lines changed

.github/workflows/test-install.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44
env:
55
BUILDDOCS: 0
66
INSTALLC: 1
7+
INSTALLEXCEL: 1
78
INSTALLFORTRAN: 1
9+
INSTALLIMAGES: 1
810
INSTALLJULIA: 1
911
INSTALLLPY: 0
1012
INSTALLMATLAB: 0
1113
INSTALLMPI: 1
1214
INSTALLOMP: 1
1315
INSTALLPYGMENTS: 1
16+
INSTALLPYTORCH: 1
1417
INSTALLR: 1
1518
INSTALLRMQ: 0
1619
INSTALLSBML: 0
20+
INSTALLSEQ: 1
1721
INSTALLTRIMESH: 1
1822
INSTALLZMQ: 1
1923
NUMPY: numpy
@@ -276,6 +280,8 @@ jobs:
276280
== 1
277281
name: Install R
278282
uses: r-lib/actions/setup-r@v2
283+
with:
284+
r-version: 4.2.3
279285
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
280286
name: (LINUX,PIP) Cache pip
281287
uses: actions/cache@v3
@@ -607,6 +613,8 @@ jobs:
607613
== 1
608614
name: Install R
609615
uses: r-lib/actions/setup-r@v2
616+
with:
617+
r-version: 4.2.3
610618
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
611619
name: (LINUX,PIP) Cache pip
612620
uses: actions/cache@v3
@@ -930,6 +938,8 @@ jobs:
930938
== 1
931939
name: Install R
932940
uses: r-lib/actions/setup-r@v2
941+
with:
942+
r-version: 4.2.3
933943
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
934944
name: (LINUX,PIP) Cache pip
935945
uses: actions/cache@v3
@@ -1236,6 +1246,8 @@ jobs:
12361246
== 1
12371247
name: Install R
12381248
uses: r-lib/actions/setup-r@v2
1249+
with:
1250+
r-version: 4.2.3
12391251
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
12401252
name: (LINUX,PIP) Cache pip
12411253
uses: actions/cache@v3
@@ -1541,6 +1553,8 @@ jobs:
15411553
== 1
15421554
name: Install R
15431555
uses: r-lib/actions/setup-r@v2
1556+
with:
1557+
r-version: 4.2.3
15441558
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
15451559
name: (LINUX,PIP) Cache pip
15461560
uses: actions/cache@v3

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ tmp/
6565
*.lib
6666
*.exe
6767

68+
yggdrasil/examples/pytorch1/Input/data/
69+
6870
# Compiled things - not managed
6971
*.pyc
7072
*.o

HISTORY.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
History
33
=======
44

5+
1.10.0 (2023-05-31) Added support for PyTorch models, sequence files, image files, and Excel files
6+
-------------------
7+
8+
* Added support for running trained PyTorch models as part of integrations
9+
* Added support for connecting integrations to sequence files in FASTA and FASTQ formats via BioPython
10+
* Added support for connecting integrations to sequence files in SAM, BAM and CRAM formats via pysam
11+
* Added support for connecting integrations to sequence files in BCF and VCF formats via pysam
12+
* Added support for connecting integrations to JPEG, PNG, EPS, BMP, GIF and TIFF formats via Pillow
13+
* Added support for connecting integrations to Excel files via Pandas
14+
* Refactor serialization in preparation of moving communication into C++
15+
* Added CLI for converting files between compatible formats
16+
* Added support for creating Ply and ObjWavefront objects from explicit meshes
17+
* Fix bug in R interface
18+
519
1.9.0 (2023-04-14) Migrate to using extended version of rapidjson/python-rapidjson for serialization and add support for models written in Julia
620
------------------
721

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ recursive-include yggdrasil *.xml
2222
recursive-include yggdrasil *.jl
2323
recursive-include yggdrasil/examples *.py
2424
recursive-include yggdrasil/examples *.rst
25+
recursive-include yggdrasil/examples *.png
26+
recursive-include yggdrasil/examples *.pth
2527
recursive-include yggdrasil/demos *.py
2628
recursive-include yggdrasil/tests/scripts *.py
2729
recursive-include yggdrasil/examples Makefile_linux
@@ -44,6 +46,7 @@ include yggdrasil/regex/CMakeLists.txt
4446
include yggdrasil/tests/scripts/CMakeLists.txt
4547
include yggdrasil/tests/scripts/Makefile_linux
4648
include yggdrasil/tests/scripts/Makefile_windows
49+
include yggdrasil/tests/data/example.vcf
4750
graft docs
4851
include versioneer.py
4952
include yggdrasil/_version.py

docs/source/development/todo.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Refactor
2828
* Split drivers into separate directories for model drivers and connection drivers
2929
* Change how CLI arguments are added to the arg parser for the language installer to use subparsers
3030
* Use doxygen linter/parser for parsing functions
31+
* Add parameter to files/serializers to allow incremental or complete read on file types where that is valid
3132

3233
New feature/example
3334
-------------------
@@ -41,8 +42,9 @@ New feature/example
4142
* Assign meanings to error codes and implement across languages (e.g. missing comm class)
4243
* Add parameters constraining valid values for inputs/outputs (e.g. range) using JSON paramaters
4344
* Allow users to select from list of multiple possiblities when locating libraries to avoid conflict
44-
* Write C/C++ as extension to rapidjson and wrap in Python
4545
* Add 'shell' option for executable models on Windows to allow calling different shell types.
46+
* Move communication to C++
47+
* Allow models to be embedded natively
4648

4749
Testing
4850
-------

docs/source/examples/make_example_rst.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
'sbml': 'SBML',
2121
'osr': 'OpenSimRoot',
2222
'dummy': 'Dummy',
23-
'timesync': 'Timesync'}
24-
_default_lang = ['python', 'cpp', 'c', 'R', 'fortran', 'matlab', 'sbml']
23+
'timesync': 'Timesync',
24+
'pytorch': 'PyTorch'}
25+
_default_lang = ['python', 'cpp', 'c', 'R', 'fortran', 'matlab',
26+
'sbml', 'pytorch']
2527

2628

2729
def get_file(fname, local=False):

recipe/meta.yaml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "yggdrasil" %}
2-
{% set version = "1.9.1" %}
2+
{% set version = "1.10.0" %}
33
{% set PY_VER_MAJOR = PY_VER.split('.')[0] %}
44
{% set PY_VER_MINOR = PY_VER.split('.')[1] %}
55

@@ -187,6 +187,53 @@ outputs:
187187
run:
188188
- {{ pin_subpackage('yggdrasil', exact=True) }}
189189
- pika >=1.0.0
190+
- name: yggdrasil.images
191+
build:
192+
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
193+
run_exports:
194+
- {{ pin_subpackage('yggdrasil.images') }}
195+
requirements:
196+
host:
197+
- python
198+
run:
199+
- {{ pin_subpackage('yggdrasil', exact=True) }}
200+
- ghostscript
201+
- pillow
202+
- name: yggdrasil.seq
203+
build:
204+
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
205+
run_exports:
206+
- {{ pin_subpackage('yggdrasil.seq') }}
207+
requirements:
208+
host:
209+
- python
210+
run:
211+
- {{ pin_subpackage('yggdrasil', exact=True) }}
212+
- biopython
213+
- name: yggdrasil.pytorch
214+
build:
215+
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
216+
run_exports:
217+
- {{ pin_subpackage('yggdrasil.pytorch') }}
218+
requirements:
219+
host:
220+
- python
221+
run:
222+
- {{ pin_subpackage('yggdrasil', exact=True) }}
223+
- pytorch # [not win]
224+
- torchvision # [not win]
225+
- name: yggdrasil.excel
226+
build:
227+
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}
228+
run_exports:
229+
- {{ pin_subpackage('yggdrasil.excel') }}
230+
requirements:
231+
host:
232+
- python
233+
run:
234+
- {{ pin_subpackage('yggdrasil', exact=True) }}
235+
- openpyxl
236+
- pandas
190237
- name: yggdrasil.testing
191238
build:
192239
string: py{{ PY_VER_MAJOR }}{{ PY_VER_MINOR }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}

tests/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,13 @@ def python_class(self, component_type, component_subtype):
280280
def options(self):
281281
r"""Arguments that should be provided when getting testing options."""
282282
return {}
283-
283+
284284
@pytest.fixture(scope="class")
285-
def testing_options(self, python_class, options):
285+
def testing_options(self, python_class, options, testdir):
286286
r"""Testing options."""
287287
if 'explicit_testing_options' in options:
288288
return copy.deepcopy(options['explicit_testing_options'])
289+
options['test_dir'] = testdir
289290
return python_class.get_testing_options(**options)
290291

291292
@pytest.fixture

tests/communication/test_CommBase.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import copy
44
import pytest
55
from yggdrasil import platform
6-
from yggdrasil.communication import new_comm, get_comm
6+
from yggdrasil.communication import new_comm, get_comm, AddressError
77
from yggdrasil.tools import get_supported_comm
88
from tests import TestComponentBase
99

@@ -78,6 +78,7 @@ def get_send_comm_kwargs(self, commtype, use_async,
7878
kws = dict(commtype=commtype, reverse_names=True,
7979
direction='send', use_async=use_async)
8080
kws.update(testing_options['kwargs'])
81+
kws.update(testing_options.get('send_kwargs', {}))
8182
kws.update(kwargs)
8283
return kws
8384

@@ -176,7 +177,14 @@ def wrapped_do_send_recv(send_comm, recv_comm, message=None,
176177
recv_comm, recv_params.get('method', 'recv'))(
177178
**recv_params.get('kwargs', {'timeout': 0}))
178179
assert flag == recv_params.get('flag', True)
179-
assert nested_approx(recv_params['message']) == msg
180+
try:
181+
assert nested_approx(recv_params['message']) == msg
182+
except BaseException:
183+
print("EXPECTED:")
184+
print(recv_params['message'])
185+
print("ACTUAL:")
186+
print(msg)
187+
raise
180188
if not send_params.get('skip_wait', False):
181189
wait_on_function(
182190
lambda: send_comm.is_closed or (send_comm.n_msg_send == 0))
@@ -354,7 +362,7 @@ def test_empty_obj_recv(self, run_once, global_comm):
354362

355363
def test_error_name(self, python_class):
356364
r"""Test error on missing address."""
357-
with pytest.raises(RuntimeError):
365+
with pytest.raises(AddressError):
358366
python_class('test%s' % uuid.uuid4())
359367

360368
def test_error_send(self, monkeypatch, send_comm, testing_options,

0 commit comments

Comments
 (0)