Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeyeongYang committed Dec 24, 2020
2 parents f4783e3 + 1ecd36d commit 279b7ea
Show file tree
Hide file tree
Showing 194 changed files with 15,795 additions and 4,101 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
52 changes: 52 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
push:
branches:
- master

name: Documentation

jobs:
pkgdown:
runs-on: macOS-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "../.github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), "../.github/R-version")
shell: Rscript {0}
working-directory: ./R

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}

- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary", quiet = TRUE)
shell: Rscript {0}
working-directory: ./R

- name: Install package
run: R CMD INSTALL .
working-directory: ./R

- name: Deploy package
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
working-directory: ./R
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
language: r
r: release

sudo: required

os: linux
dist: trusty
dist: xenial

branches:
only:
Expand All @@ -32,22 +30,26 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- git
- gcc-7
- g++-7
- gfortran-7
- libcurl4-openssl-dev
- libxml2-dev
- libgit2-dev
- libharfbuzz-dev
- libfribidi-dev

matrix:
jobs:
include:
- name: 'Test R codes'
env: TARGET='R'
- name: 'Test Python codes (Python 3.5)'
env: TARGET='Python' && PYTHON_VERSION=3.5
- name: 'Test Python codes (Python 3.6)'
env: TARGET='Python' && PYTHON_VERSION=3.6
- name: 'Test Python codes (Python 3.7)'
env: TARGET='Python' && PYTHON_VERSION=3.7
- name: 'Test Python codes (Python 3.8)'
env: TARGET='Python' && PYTHON_VERSION=3.8

before_install:
- export ROOTPATH=`pwd`
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
# Great thanks to our contributors!

Ayoung Lee <aylee2008@naver.com>
David Munoz Tord <david.munoztord@unige.ch>
Dayeong Min <mindy2801@snu.ac.kr>
Harhim Park <hrpark12@gmail.com>
Heesun Park <heesunpark26@gmail.com>
Jaeyeong Yang <jaeyeong.yang1125@gmail.com>
Jeongbin Oh <ows0104@gmail.com>
Jethro Lee <dlemfh96@gmail.com>
Jiyoon Lee <nicole.lee2001@gmail.com>
Junha Jang <andy627robo@naver.com>
Lei Zhang <bnuzhanglei2008@gmail.com>
Lili Zhang <lili.zhang27@mail.dcu.ie>
Nathaniel Haines <haines.175@osu.edu>
Woo-Young Ahn <wooyoung.ahn@gmail.com>
Yoonseo Zoh <zohyos7@gmail.com>

9 changes: 9 additions & 0 deletions Python/hbayesdm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# -*- coding: utf-8 -*-
try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError:
import importlib_metadata

import hbayesdm
from hbayesdm.diagnostics import *

__all__ = []
__all__ += hbayesdm.diagnostics.__all__

# Load version from the metadata
__version__ = importlib_metadata.version(__name__)
16 changes: 10 additions & 6 deletions Python/hbayesdm/base.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import multiprocessing
import os
from pathlib import Path
import pickle
import warnings
import multiprocessing
from abc import ABCMeta, abstractmethod
from typing import Tuple, List, Sequence, Dict, Union, Callable, Any
from collections import OrderedDict
from pathlib import Path
from typing import Any, Callable, Dict, List, Sequence, Tuple, Union

import numpy as np
import pandas as pd
from scipy import stats
from pystan import StanModel
import matplotlib.pyplot as plt
import arviz as az

import arviz as az
import matplotlib.pyplot as plt
from pystan import StanModel
from pystan import __version__ as _pystan_version

__all__ = ['TaskModel']
Expand Down Expand Up @@ -246,7 +246,11 @@ def _handle_data_args(self, data) -> Tuple[pd.DataFrame, List]:
else:
filename = '%s_%s_exampleData.txt' % (
self.task_name, self.model_type)

example_data = PATH_EXTDATA / filename
if not example_data.exists():
raise RuntimeError(
'Example data for this task does not exist.')
raw_data = pd.read_csv(example_data, sep='\t')
else:
if data.endswith('.csv'):
Expand Down
10 changes: 10 additions & 0 deletions Python/hbayesdm/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from ._alt_delta import alt_delta
from ._alt_gamma import alt_gamma
from ._bandit2arm_delta import bandit2arm_delta
from ._bandit4arm2_kalman_filter import bandit4arm2_kalman_filter
from ._bandit4arm_2par_lapse import bandit4arm_2par_lapse
from ._bandit4arm_4par import bandit4arm_4par
from ._bandit4arm_lapse import bandit4arm_lapse
from ._bandit4arm_lapse_decay import bandit4arm_lapse_decay
from ._bandit4arm_singleA_lapse import bandit4arm_singleA_lapse
from ._bart_ewmv import bart_ewmv
from ._bart_par4 import bart_par4
from ._cgt_cm import cgt_cm
from ._choiceRT_ddm import choiceRT_ddm
Expand Down Expand Up @@ -34,11 +37,13 @@
from ._prl_fictitious_woa import prl_fictitious_woa
from ._prl_rp import prl_rp
from ._prl_rp_multipleB import prl_rp_multipleB
from ._pst_Q import pst_Q
from ._pst_gainloss_Q import pst_gainloss_Q
from ._ra_noLA import ra_noLA
from ._ra_noRA import ra_noRA
from ._ra_prospect import ra_prospect
from ._rdt_happiness import rdt_happiness
from ._task2AFC_sdt import task2AFC_sdt
from ._ts_par4 import ts_par4
from ._ts_par6 import ts_par6
from ._ts_par7 import ts_par7
Expand All @@ -47,13 +52,16 @@
from ._wcs_sql import wcs_sql

__all__ = [
'alt_delta',
'alt_gamma',
'bandit2arm_delta',
'bandit4arm2_kalman_filter',
'bandit4arm_2par_lapse',
'bandit4arm_4par',
'bandit4arm_lapse',
'bandit4arm_lapse_decay',
'bandit4arm_singleA_lapse',
'bart_ewmv',
'bart_par4',
'cgt_cm',
'choiceRT_ddm',
Expand Down Expand Up @@ -83,11 +91,13 @@
'prl_fictitious_woa',
'prl_rp',
'prl_rp_multipleB',
'pst_Q',
'pst_gainloss_Q',
'ra_noLA',
'ra_noRA',
'ra_prospect',
'rdt_happiness',
'task2AFC_sdt',
'ts_par4',
'ts_par6',
'ts_par7',
Expand Down

0 comments on commit 279b7ea

Please sign in to comment.