-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Swap to pdm * Use quivr's drop_duplicates * Upgrade adam_core >= 0.2.5
- Loading branch information
Showing
87 changed files
with
552 additions
and
1,249 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -16,38 +16,36 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
OORB_DATA: /tmp/oorb/data | ||
|
||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v4 | ||
- name: Get git tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Set up miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: "thor" | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install openorb using conda | ||
run: conda install -c defaults -c conda-forge openorb --yes | ||
- name: Update OBSCODE.dat | ||
run: | | ||
cd $CONDA_PREFIX/share/oorb | ||
curl https://www.minorplanetcenter.net/iau/lists/ObsCodes.html -o ObsCodes.html | ||
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat | ||
rm -f ObsCodes.html | ||
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # caching pip dependencies | ||
- name: Build and install | ||
run: pip install .[tests] | ||
- name: Install openorb dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y gfortran liblapack-dev | ||
wget -P /tmp/ https://storage.googleapis.com/oorb-data/oorb_data.tar.gz | ||
mkdir -p /tmp/oorb/ | ||
tar -xvf /tmp/oorb_data.tar.gz -C /tmp/oorb/ | ||
- name: Install Dependencies | ||
run: | | ||
pip install pip --upgrade | ||
pip install ".[dev]" | ||
- name: Lint | ||
run: pre-commit run --all-files | ||
- name: Test | ||
run: pytest . --cov --cov-report xml | ||
- name: Coverage | ||
run: pdm run lint | ||
# - name: Type check | ||
# run: pdm run typecheck | ||
- name: Test with coverage | ||
run: pdm run coverage | ||
- name: Coverage Report | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.COVERALLS_TOKEN }} | ||
|
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 was deleted.
Oops, something went wrong.
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,56 +1,22 @@ | ||
FROM ubuntu:latest | ||
FROM python:3.11 | ||
|
||
# Set shell to bash | ||
SHELL ["/bin/bash", "-c"] | ||
CMD ["/bin/bash"] | ||
|
||
# Update system dependencies | ||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y curl gfortran git liblapack-dev make pip python3.11 python-is-python3 unzip wget | ||
&& apt-get install -y pip git wget tar gfortran liblapack-dev | ||
|
||
# Upgrade pip to the latest version and install pre-commit | ||
RUN pip install --upgrade pip pre-commit | ||
RUN pip install --upgrade cython==0.29.36 setuptools setuptools_scm | ||
RUN chmod 777 /opt | ||
|
||
# Install numpy | ||
RUN git clone https://github.com/numpy/numpy.git /opt/numpy | ||
RUN cd /opt/numpy && git checkout v1.24.4 && git submodule update --init | ||
RUN cd /opt/numpy && python3 setup.py build --cpu-baseline=native install | ||
|
||
|
||
# Install openorb | ||
# TODO: We need a more robust way to be appropriately natively compiled pyoorb installed | ||
# including data file generation | ||
RUN git clone https://github.com/B612-Asteroid-Institute/oorb.git /opt/oorb | ||
RUN cd /opt/oorb && git checkout fork | ||
RUN cd /opt/oorb && ./configure gfortran opt --with-pyoorb --with-f2py=/usr/local/bin/f2py --with-python=python3 | ||
# Add '-march=native' to compiler options by running a sed | ||
# script directly on the Makefile.includse file. This is a | ||
# hack to get around the fact that the configure script | ||
# doesn't support this option. | ||
RUN sed -i 's/FCOPTIONS = .*/FCOPTIONS = $(FCOPTIONS_OPT_GFORTRAN) -march=native/g' /opt/oorb/Makefile.include | ||
# --no-build-isolation is needed because we need to ensure we use | ||
# the same version of numpy as the one we compiled previously so | ||
# that it matches the version of f2py we passed in to ./configure. | ||
RUN pip install --no-build-isolation -v /opt/oorb | ||
|
||
# Generate the data files | ||
RUN cd /opt/oorb && make ephem | ||
RUN cd /opt/oorb/data && ./getBC430 | ||
RUN cd /opt/oorb/data && ./updateOBSCODE | ||
ENV OORBROOT=/opt/oorb | ||
ENV OORB_DATA=/opt/oorb/data | ||
|
||
# Install pre-commit hooks (before THOR is installed to cache this step) | ||
RUN mkdir /code/ | ||
COPY .pre-commit-config.yaml /code/ | ||
WORKDIR /code/ | ||
RUN git init . \ | ||
&& git add .pre-commit-config.yaml \ | ||
&& pre-commit install-hooks \ | ||
&& rm -rf .git | ||
# Install openorb dependencies | ||
RUN wget -P /tmp/ https://storage.googleapis.com/oorb-data/oorb_data.tar.gz \ | ||
&& mkdir -p /tmp/oorb/ \ | ||
&& tar -xvf /tmp/oorb_data.tar.gz -C /tmp/oorb/ | ||
ENV OORB_DATA=/tmp/oorb/data/ | ||
|
||
# Install THOR | ||
RUN mkdir -p /code/ | ||
WORKDIR /code/ | ||
ADD . /code/ | ||
RUN SETUPTOOLS_SCM_PRETEND_VERSION=1 pip install -e .[tests,dev] | ||
RUN pip install -e .[dev] |
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,4 +1,4 @@ | ||
include thor/*.py | ||
include src/*.py | ||
include *.md | ||
include *.toml | ||
include *.yaml |
Oops, something went wrong.