-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to Python 3.10 and TF 2.15 (#281)
This adds support for Python 3.10 and moves MB up to 2.15 on that version (which requires C++20 support (since 2.13). I have maintained the stepped approach to tensorflow versions making the software backwards compatible to Python 3.6.
- Loading branch information
Showing
33 changed files
with
162 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /optsoft/tensorflow | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV DEBIAN_DEPENDENCIES wget \ | ||
build-essential \ | ||
python3-pip \ | ||
git \ | ||
python3-casacore \ | ||
casacore-data | ||
|
||
# setup base dependencies | ||
RUN apt update && apt install -y ${DEBIAN_DEPENDENCIES} | ||
RUN pip3 install -U pip setuptools wheel | ||
|
||
##################################################### | ||
# install montblanc including specified tensorflow | ||
##################################################### | ||
# copy into workspace | ||
WORKDIR /src/montblanc | ||
ADD docs /src/montblanc/docs | ||
ADD montblanc /src/montblanc/montblanc | ||
ADD CHANGELOG.md /src/montblanc/CHANGELOG.log | ||
ADD CONTRIBUTORS.md /src/montblanc/CONTRIBUTORS.md | ||
ADD LICENSE.md /src/montblanc/LICENSE.md | ||
ADD MANIFEST.in /src/montblanc/MANIFEST.in | ||
ADD pyproject.toml /src/montblanc/pyproject.toml | ||
ADD README.rst /src/montblanc/README.rst | ||
ADD readthedocs.yml /src/montblanc/readthedocs.yml | ||
ADD requirements.readthedocs.txt /src/montblanc/requirements.readthedocs.txt | ||
ADD setup.cfg /src/montblanc/setup.cfg | ||
ADD setup.py /src/montblanc/setup.py | ||
|
||
RUN pip3 install -U setuptools wheel pip | ||
RUN pip3 install /src/montblanc | ||
|
||
WORKDIR /mb_testing | ||
RUN python3 -c "from montblanc.impl.rime.tensorflow import load_tf_lib; load_tf_lib()" | ||
# to run tests we need to be in dev install - pkg_requirements return the path to the source, | ||
# not the install otherwise leading to library load path errors | ||
RUN pip3 install -e /src/montblanc | ||
|
||
# run tests | ||
WORKDIR /mb_testing | ||
ENV TESTS_TO_RUN /src/montblanc/montblanc/tests/beam_factory.py \ | ||
/src/montblanc/montblanc/tests/test_antenna_uvw_decomposition.py \ | ||
/src/montblanc/montblanc/tests/test_source_utils.py \ | ||
/src/montblanc/montblanc/tests/test_source_utils.py \ | ||
/src/montblanc/montblanc/tests/test_utils.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_b_sqrt.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_create_antenna_jones.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_e_beam.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_feed_rotation.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_gauss_shape.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_parallactic_angle_sin_cos.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_phase.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_post_process_visibilities.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_radec_to_lm.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_sersic_shape.py \ | ||
/src/montblanc/montblanc/impl/rime/tensorflow/rime_ops/test_sum_coherencies.py | ||
|
||
# run tests | ||
# skip meqtrees acceptance test in this case as it is covered by other cases | ||
# and it does not yet build on newer GCC | ||
RUN pynose $TESTS_TO_RUN | ||
|
||
RUN pip install git+https://github.com/ratt-ru/simms.git@7984aee13e2d7bd32408ce9388b7960bfc0b2e27 # BH: todo until I can make a release! | ||
RUN pip install casadata | ||
WORKDIR /mb_testing | ||
RUN mkdir data | ||
WORKDIR /mb_testing/data | ||
RUN python3 -m pip install simms 'eidos>=1.1.1' | ||
RUN simms -dir "J2000,00h00m00.0000000s,-10d00m00.00s" -T meerkat -dt 30 -st 0.5 -nc 15 -f0 856MHz -df 57066.66667kHz -pl XX XY YX YY -n mk64.Lwide.0.5hr.30s.856mhz.ms | ||
RUN eidos -d 4 -r 0.015625 -f 856 1712 142 -P test_beam_ -o8 | ||
|
||
#run example montblanc recipe | ||
WORKDIR /mb_testing | ||
RUN python3 /src/montblanc/montblanc/examples/MS_tf_example.py /mb_testing/data/mk64.Lwide.0.5hr.30s.856mhz.ms \ | ||
-b /mb_testing/data/test_beam_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.ci | ||
rime.so | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
montblanc/impl/rime/tensorflow/rime_ops/create_antenna_jones_op.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
montblanc/impl/rime/tensorflow/rime_ops/montblanc_macros.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef MONTBLANC_MACROS_H | ||
#define MONTBLANC_MACROS_H | ||
|
||
#ifdef DCOMPAT_TF2_4 | ||
#define MB_STAT_OK Status::OK | ||
#else | ||
#define MB_STAT_OK Status | ||
#endif //DCOMPAT_TF2_4 | ||
|
||
#endif //MONTBLANC_MACROS_H |
1 change: 1 addition & 0 deletions
1
montblanc/impl/rime/tensorflow/rime_ops/parallactic_angle_sin_cos_op.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
montblanc/impl/rime/tensorflow/rime_ops/post_process_visibilities_op.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
montblanc/impl/rime/tensorflow/rime_ops/sum_coherencies_op_cpu.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[build-system] | ||
requires = ['tensorflow >= 2.7.0,<=2.8.4; python_version >="3.8"', | ||
requires = ['tensorflow >= 2.7.0,<=2.15.0; python_version >="3.10"', | ||
'tensorflow >= 2.7.0,<=2.8.4; python_version >="3.8" and python_version <"3.10"', | ||
'tensorflow <=2.4.4; python_version <"3.8"', | ||
"setuptools >= 0.53.0"] | ||
build-backend = "setuptools.build_meta" |
Oops, something went wrong.