Skip to content

Commit

Permalink
[merge]
Browse files Browse the repository at this point in the history
  • Loading branch information
milobanks committed Jan 29, 2025
2 parents 3e77195 + e7158e2 commit 09deff2
Show file tree
Hide file tree
Showing 33 changed files with 580 additions and 448 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 0 additions & 8 deletions .codacy.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest]
python-version: ["3.7", "3.11"]
platform: [ubuntu-22.04]
python-version: ["3.10.4", "3.11.0"]

steps:
- uses: actions/checkout@v4
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Publish to PyPI"

on:
release:
types: [published]

jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: pip install .

- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: "${{ secrets.PYPI_API_KEY }}"
run: |
twine upload dist/*
30 changes: 23 additions & 7 deletions .github/workflows/sphinx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ on:
types: [published]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,16 +53,38 @@ jobs:
run: mv README_files docs/build/html

# Upload
- name: Upload artifacts
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: docs/build/html/

post-page-artifact:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Post comment preview
uses: CDCgov/cfa-actions/post-artifact@v1.0.0
with:
artifact-name: github-pages
gh-token: ${{ secrets.GITHUB_TOKEN}}
message: "Thanks for your contribution, ${{ github.actor }}; your `{ artifact-name }` is ready for download [here]({ artifact-url })."

deploy:
# Deploy to the github-pages environment
# but not on PRs
if: ${{ github.event_name != 'pull_request' }}
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
.cache/
.ipynb_checkpoints/
.pytest_cache/
.ropeproject/
.nocheck/
_build/
dist/
build/
dist/
__pycache__/
*.egg-info/
.ropeproject/

compile_commands.json

*.html
*.ipynb
.nocheck/

*_files
!README_files
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ include_directories(include/epiworld)

python_add_library(_core MODULE
src/database.cpp
src/entity.cpp
src/main.cpp
src/model.cpp
src/saver.cpp
Expand Down
34 changes: 34 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"

config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 2
end

config.vm.network "private_network", type: "dhcp"

config.vm.provision "shell", inline: <<-SHELL
# Update and install prerequisites
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv cmake build-essential
# Create a Python virtual environment
python3 -m venv /home/vagrant/epiworldPy-env
# Activate virtual environment and upgrade pip
source /home/vagrant/epiworldPy-env/bin/activate
pip install --upgrade pip setuptools wheel
# Install dependencies from pyproject.toml (if it exists)
if [ -f /vagrant/pyproject.toml ]; then
pip install .
fi
# Deactivate the virtual environment
deactivate
SHELL

# Synchronize the project directory with the VM
config.vm.synced_folder ".", "/vagrant"
end
40 changes: 0 additions & 40 deletions conda.recipe/meta.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
# built documents.
#
# The short X.Y version.
version = '0.0.1'
version = '0.6.0-0'
# The full version, including alpha/beta/rc tags.
release = '0.0.1'
release = '0.6.0-0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 3 additions & 3 deletions include/epiworld/agent-meat-virus-sampling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace sampler {
* @return Virus<TSeq>* of the selected virus. If none selected (or none
* available,) returns a nullptr;
*/
template<typename TSeq>
template<typename TSeq = EPI_DEFAULT_TSEQ>
inline std::function<void(Agent<TSeq>*,Model<TSeq>*)> make_update_susceptible(
std::vector< epiworld_fast_uint > exclude = {}
)
Expand Down Expand Up @@ -179,7 +179,7 @@ inline std::function<void(Agent<TSeq>*,Model<TSeq>*)> make_update_susceptible(
* @return Virus<TSeq>* of the selected virus. If none selected (or none
* available,) returns a nullptr;
*/
template<typename TSeq = int>
template<typename TSeq = EPI_DEFAULT_TSEQ>
inline std::function<Virus<TSeq>*(Agent<TSeq>*,Model<TSeq>*)> make_sample_virus_neighbors(
std::vector< epiworld_fast_uint > exclude = {}
)
Expand Down Expand Up @@ -347,7 +347,7 @@ inline std::function<Virus<TSeq>*(Agent<TSeq>*,Model<TSeq>*)> make_sample_virus_
* @return Virus<TSeq>* of the selected virus. If none selected (or none
* available,) returns a nullptr;
*/
template<typename TSeq = int>
template<typename TSeq = EPI_DEFAULT_TSEQ>
inline Virus<TSeq> * sample_virus_single(Agent<TSeq> * p, Model<TSeq> * m)
{

Expand Down
4 changes: 2 additions & 2 deletions include/epiworld/epiworld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* Versioning */
#define EPIWORLD_VERSION_MAJOR 0
#define EPIWORLD_VERSION_MINOR 4
#define EPIWORLD_VERSION_MINOR 6
#define EPIWORLD_VERSION_PATCH 0

static const int epiworld_version_major = EPIWORLD_VERSION_MAJOR;
Expand Down Expand Up @@ -88,4 +88,4 @@ namespace epiworld {

}

#endif
#endif
Loading

0 comments on commit 09deff2

Please sign in to comment.