Skip to content

Commit

Permalink
Merge pull request #12 from chenyangkang/chenyangkang-JOSS-review
Browse files Browse the repository at this point in the history
add pre-commit
  • Loading branch information
chenyangkang authored Jan 9, 2024
2 parents 8e0bcc7 + 0fc8315 commit 498ff7a
Show file tree
Hide file tree
Showing 44 changed files with 2,361 additions and 2,128 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.ipynb linguist-vendored
*.md linguist-vendored
*.bib linguist-vendored

6 changes: 3 additions & 3 deletions .github/workflows/compile_docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: compile_docs
name: compile_docs

on:
push:
paths:
- 'docs/**'
# paths:
# - 'docs/**'
branches:
- main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
# - name: save pdf to repo
# uses: chenyangkang/git-auto-commit-action@v4
# with:
# commit_message: Saved new PDF of paper
# commit_message: Saved new PDF of paper
39 changes: 39 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# name: publish-pypi
# on:
# push:
# paths:
# - 'stemflow/version.py'
# tags:
# - "v*.*.*.*"

# jobs:
# publish:
# runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/stemflow/
# permissions:
# id-token: write
# steps:
# - uses: actions/checkout@v4
# - name: Python setup
# uses: actions/setup-python@v5
# with:
# python-version: 3.9
# cache: 'pip'
# - name: Install package
# run: |
# python -m pip install --upgrade pip
# pip install wheel
# pip install .
# - name: Build package
# run: |
# python setup.py sdist bdist_wheel
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
# packages_dir: ./dist
# # repository-url: https://pypi.org/p/stemflow/
# verbose: true
4 changes: 2 additions & 2 deletions .github/workflows/run_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# - uses: action-badges/create-orphan-branch@0.1.0
# with:
# branch-name: badges
Expand All @@ -46,4 +46,4 @@ jobs:
# file-name: coverage.svg
# badge-branch: badges
# github-token: '${{ secrets.SECRET_TOKEN }}'
# coverage-file-name: ./coverage.xml
# coverage-file-name: ./coverage.xml
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# default_language_version:
# python: python3.8

repos:
- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
args: ["stemflow", "--line-length=120", "--target-version=py37"]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--select=C,E,F,W,B,B950", "--max-line-length=120", "--ignore=E203,E501,W503,F401,F403"]

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: ["-l 120", "--profile", "black", "."]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
exclude: recipe/meta.yaml
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: detect-private-key
- id: end-of-file-fixer
- id: requirements-txt-fixer
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.mini_test.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# stemflow.mini_test

::: stemflow.mini_test
::: stemflow.mini_test
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.model.Hurdle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

---
:::stemflow.model.Hurdle
---
---
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.model.dummy_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

---
:::stemflow.model.dummy_model
---
---
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.model.special_hurdle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

---
:::stemflow.model.special_hurdle
---
---
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.model_selection.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# stemflow.model_selection

::: stemflow.model_selection
::: stemflow.model_selection
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# stemflow.utils.generate_soft_colors

:::stemflow.utils.generate_soft_colors
:::stemflow.utils.generate_soft_colors
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.utils.plot_gif.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

---
:::stemflow.utils.plot_gif
---
---
2 changes: 1 addition & 1 deletion docs/API_Documentation/stemflow.utils.quadtree.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

---
:::stemflow.utils.quadtree
---
---
3 changes: 0 additions & 3 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ git remote add upstream git://github.com/stemflow/stemflow.git
This creates the directory `stemflow-YOURNAME` and connects your repository to the upstream (main project) elapid repository.

---



3 changes: 0 additions & 3 deletions docs/Fun_Visualization/Global_Bird_Shannon_H_Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ Data Source: eBird


![](./shannon_H_2020.gif)



4 changes: 0 additions & 4 deletions docs/Fun_Visualization/Global_Mean_Temperature_2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ Notice: the visualized data is not modeled by AdaSTEM. Only visualization functi


![](./Temp_2020.gif)




3 changes: 0 additions & 3 deletions docs/Fun_Visualization/Global_NDVI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ Notice: the visualized data is not modeled by AdaSTEM. Only visualization functi


![](./NDVI_2020.gif)



2 changes: 0 additions & 2 deletions docs/Fun_Visualization/Ruby-crowned_Kinglet_2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ Data Source: eBird
![](./Ruby-crowned_Kinglet_2020.gif)

It's quite amazing that the Ruby-crowned_Kinglet gathered for wintering and spread into two distinct populations during the breeding season.


2 changes: 1 addition & 1 deletion docs/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
.md-content {
margin-right: 0;
}
} */
} */
13 changes: 7 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
![PyPI version](https://img.shields.io/pypi/v/stemflow)
![PyPI downloads](https://img.shields.io/pypi/dm/stemflow)
![GitHub last commit](https://img.shields.io/github/last-commit/chenyangkang/stemflow)
[![codecov](https://codecov.io/gh/chenyangkang/stemflow/graph/badge.svg?token=RURPF6NKIJ)](https://codecov.io/gh/chenyangkang/stemflow)
[![status](https://joss.theoj.org/papers/50a385b3283faf346fc16484f50f6add/status.svg)](https://joss.theoj.org/papers/50a385b3283faf346fc16484f50f6add)
<!-- -->

-----

## Documentation :book:
Expand Down Expand Up @@ -68,22 +69,22 @@ model = AdaSTEMRegressor(
regressor=XGBRegressor(tree_method='hist',random_state=42, verbosity = 0, n_jobs=1)
),
save_gridding_plot = True,
ensemble_fold=10,
ensemble_fold=10,
min_ensemble_required=7,
grid_len_lon_upper_threshold=25,
grid_len_lon_lower_threshold=5,
grid_len_lat_upper_threshold=25,
grid_len_lat_lower_threshold=5,
temporal_start = 1,
temporal_start = 1,
temporal_end =366,
temporal_step=20,
temporal_bin_interval = 50,
points_lower_threshold=50,
Spatio1='longitude',
Spatio2 = 'latitude',
Spatio2 = 'latitude',
Temporal1 = 'DOY',
use_temporal_to_train=True,
njobs=1
njobs=1
)
```

Expand Down Expand Up @@ -119,7 +120,7 @@ model.gridding_plot

Here, each color shows an ensemble generated during model fitting. In each of the 10 ensembles, regions (in terms of space and time) with more training samples were gridded into finer resolution, while the sparse one remained coarse. Prediction results were aggregated across the ensembles (that is, in this example, data were modeled 10 times).

----
----
## Example of visualization :world_map:

Daily Abundance Map of Barn Swallow
Expand Down
10 changes: 5 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extra:
# - icon: fontawesome/brands/linkedin
# link: https://www.linkedin.com/in/willettjames/


nav:
- Home: index.md
- Examples:
Expand Down Expand Up @@ -119,9 +119,9 @@ markdown_extensions:
- pymdownx.superfences
- pymdownx.mark
- attr_list
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.emoji
# emoji_index: !!python/name:materialx.emoji.twemoji
# emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.critic
- pymdownx.caret
- pymdownx.keys
Expand All @@ -132,4 +132,4 @@ extra_css:


copyright: |
&copy; 2023 <a href="https://github.com/chenyangkang" target="_blank" rel="noopener">Yangkang Chen</a>
&copy; 2023 <a href="https://github.com/chenyangkang" target="_blank" rel="noopener">Yangkang Chen</a>
4 changes: 0 additions & 4 deletions paper/md_paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,3 @@ @article{a_leeyaw_species_2022
pages = {e05877},
file = {A. Lee‐Yaw et al. - 2022 - Species distribution models rarely predict the bio.pdf:/Users/chenyangkang/Zotero/storage/47MPKJDC/A. Lee‐Yaw et al. - 2022 - Species distribution models rarely predict the bio.pdf:application/pdf},
}




6 changes: 3 additions & 3 deletions paper/md_paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors:
- given-names: Yangkang
surname: Chen
orchid: 0000-0003-4996-0881
affiliation: "1, 2"
affiliation: "1, 2"
- given-names: Zhongru
surname: Gu
orchid: 0000-0002-0178-1107
Expand All @@ -31,7 +31,7 @@ affiliations:

- name: Cardiff University-Institute of Zoology Joint Laboratory for Biocomplexity Research, Chinese Academy of Sciences, Beijing, China
index: 3

- name: Center for Excellence in Animal Evolution and Genetics, Chinese Academy of Sciences, Kunming, China
index: 4

Expand Down Expand Up @@ -65,4 +65,4 @@ While there exists mounting open source packages for species distribution modeli

This project was based upon work supported by National Natural Science Foundation of China grants 32125005 (to X.Z.), 32270455 (to Z.G.), CAS Project for Young Scientists in Basic Research (YSBR-097 to X.Z. and Z.G.). We thank Dr. Daniel Fink at Cornell Lab of Ornithology for the R scripts of STEM model and QuadTree which inspired our implementation in Python.

# References
# References
Loading

0 comments on commit 498ff7a

Please sign in to comment.