Skip to content

Commit

Permalink
Merge pull request #1 from tardis-sn/master
Browse files Browse the repository at this point in the history
Updating my Version of Tardis and Fixing Environment
  • Loading branch information
KevinCawley authored Nov 11, 2020
2 parents 983213b + 071a48e commit 5361ecb
Show file tree
Hide file tree
Showing 47 changed files with 11,335 additions and 7,197 deletions.
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

# github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
# ko_fi: # Replace with a single Ko-fi username
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
# liberapay: # Replace with a single Liberapay username
# issuehunt: # Replace with a single IssueHunt username
# otechie: # Replace with a single Otechie username
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

github: numfocus
custom: https://numfocus.org/donate-to-tardis
35 changes: 35 additions & 0 deletions .github/workflows/documentation-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: documentation-build

on:
push:
branches:
- master

jobs:
documentation_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup TARDIS Environment
uses: conda-incubator/setup-miniconda@v1
with:
environment-file: tardis_env3.yml
activate-environment: tardis
channels: conda-forge, defaults
mamba-version: "*"

- name: Install TARDIS
shell: bash -l {0}
run: python setup.py install

- name: Build Sphinx Documentation
shell: bash -l {0}
run: python setup.py build_docs

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html/
publish_branch: gh-pages
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ __pycache__
htmlcov
.coverage
.ipynb_checkpoints/
.pytest_cache/


# IDE Specific files
Expand Down Expand Up @@ -71,6 +72,3 @@ distribute-*.tar.gz

# Mac OSX
.DS_Store

# Jupyter checkpoints
.ipynb_checkpoints
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ TARDIS
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/badge/Donate-to%20TARDIS-brightgreen.svg
:target: https://numfocus.salsalabs.org/donate-to-tardis/index.html

.. image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
:target: http://numfocus.org
:alt: Powered by NumFOCUS

TARDIS is a tool that creates synthetic observations (spectra) for exploding
stars (supernovae).

Expand Down
81 changes: 36 additions & 45 deletions azure-pipelines/compare-refdata.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,64 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# For more information on how to use this pipeline please refer to:
# http://tardis-sn.github.io/tardis/development/continuous_integration.html

trigger: none
pr: none
pr: [ master ]

schedules:
- cron: '0 0 1 * *'
displayName: 'Monthly test'
branches:
include:
- master

variables:
system.debug: "true"
ref.data.home: "$(Agent.BuildDirectory)/tardis-refdata"
ref.data.github.url: "https://github.com/tardis-sn/tardis-refdata.git"
tardis.build.dir: $(Build.Repository.LocalPath)
system.debug: false

jobs:
- job: report
pool:
vmImage: "ubuntu-latest"
vmImage: 'ubuntu-latest'

steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: "Add CONDA to path"
- bash: |
sh ci-helpers/install_tardis_env.sh
displayName: "Install TARDIS env"
- template: templates/default.yml
parameters:
fetchRefdata: true
useMamba: true

- bash: |
source activate tardis
conda install bokeh -c conda-forge --no-update-deps --yes
displayName: "Install Bokeh"
$(package.manager) install bokeh --channel conda-forge --no-update-deps --yes
displayName: 'Install Bokeh'
- bash: |
source activate tardis
git clone https://github.com/tardis-sn/tardis-refdata.git $(ref.data.home)
displayName: "Fetch ALL reference data"
cd $(refdata.dir)
git remote add upstream https://tardis-sn@dev.azure.com/tardis-sn/TARDIS/_git/tardis-refdata
git fetch upstream
git fetch upstream "+refs/pull/*/head:refs/remotes/upstream/pr/*"
displayName: 'Set upstream remote'
- bash: |
cd $(tardis.dir)
source activate tardis
python setup.py build_ext --inplace
displayName: "Build & install TARDIS"
pytest tardis --tardis-refdata=$(refdata.dir) --generate-reference
displayName: 'Generate reference data'
- bash: |
cd $(refdata.dir)/notebooks
source activate tardis
python setup.py test --args="--tardis-refdata=$(ref.data.home) --generate-reference"
displayName: "Generate new reference data"
jupyter nbconvert ref_data_compare.ipynb --to html --execute --ExecutePreprocessor.timeout=6000
displayName: 'Render notebook'
- bash: |
cd $(refdata.dir)/notebooks
source activate tardis
cd $(ref.data.home)
git remote add upstream https://github.com/tardis-sn/tardis-refdata.git
git fetch upstream
git fetch upstream "+refs/pull/*/head:refs/remotes/upstream/pr/*"
cd notebooks
jupyter nbconvert ref_data_compare.ipynb --to html --execute --allow-errors --ExecutePreprocessor.timeout=6000
displayName: "Generating report"
displayName: 'Render notebook (allow errors)'
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: "$(ref.data.home)/notebooks/ref_data_compare.html"
artifact: "report"
publishLocation: "pipeline"

- bash: |
ls -lR /tmp
echo
targetPath: '$(refdata.dir)/notebooks/ref_data_compare.html'
artifactName: 'report'
displayName: 'Upload artifact'
condition: succeededOrFailed()
displayName: "Check files in /tmp"
# Keep this line, is useful for testing without changing the notebook.
# sed -i "s/ref2_hash='upstream\/pr\/24'/ref1_hash='c998f44', ref2_hash='master'/g" ref_data_compare.ipynb
74 changes: 0 additions & 74 deletions azure-pipelines/doc-build.yml

This file was deleted.

66 changes: 26 additions & 40 deletions azure-pipelines/release-version.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,47 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# For more information on how to use this pipeline please refer to:
# http://tardis-sn.github.io/tardis/development/continuous_integration.html

trigger: none
pr: none

schedules:
- cron: "30 22 * * 0"
displayName: Weekly build
- cron: '0 0 * * 0'
displayName: 'Weekly release'
branches:
include:
- master
always: true
always: false

variables:
system.debug: "true"
tardis.build.dir: $(Build.Repository.LocalPath)
system.debug: false

pool:
vmImage: "ubuntu-latest"
vmImage: 'ubuntu-latest'

jobs:
- job: gh_release
displayName: Upload GitHub release
steps:
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: "Add CONDA to path"
- bash: |
sh ci-helpers/install_tardis_env.sh
displayName: "Install TARDIS env"
- job: release
displayName: 'TARDIS release'

- bash: |
source activate tardis
python setup.py install
displayName: "Build & install TARDIS"
steps:
- template: templates/default.yml
parameters:
useMamba: true

- bash: |
cd $(tardis.dir)
source activate tardis
echo "##vso[task.setvariable variable=version]$(python -c 'import tardis; print(tardis.__version__)')"
displayName: "Get TARDIS version number"
- bash: |
echo $(VERSION)
displayName: "Recover TARDIS version number"
displayName: 'Get TARDIS version'
- task: GitHubRelease@1
inputs:
gitHubConnection: "wkerzendorf"
repositoryName: "$(Build.Repository.Name)"
action: "create"
target: "$(Build.SourceVersion)"
tagSource: "userSpecifiedTag"
tag: "v$(VERSION)"
title: "TARDIS v$(VERSION)"
isPreRelease: false
changeLogCompareToRelease: "lastFullRelease"
changeLogType: "commitBased"
gitHubConnection: 'wkerzendorf'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(version)'
title: 'TARDIS v$(version)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'
displayName: 'Create GitHub Release'
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ variables:
system.debug: false

jobs:
- job: test
displayName: 'TARDIS test'

- job:
pool:
vmImage: $[variables.vm_Image]

strategy:
matrix:
linux:
Linux:
vm_Image: 'ubuntu-latest'

mac:
macOS:
vm_Image: 'macOS-latest'

maxParallel: 2
Expand Down
Loading

0 comments on commit 5361ecb

Please sign in to comment.