Skip to content

Commit

Permalink
Merge branch '2maz/workflows'
Browse files Browse the repository at this point in the history
  • Loading branch information
2maz committed Jan 24, 2024
2 parents 8e8f0d3 + e7f3e09 commit b58e212
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 7 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy github pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install pip
run: python -m pip install -U pip

- name: Install tox
run: python -m pip install tox

- name: Generate page content
run: |
tox -e build_docs;
- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/html

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint python package

on:
push:
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install pip
run: python -m pip install -U pip

- name: Install tox
run: python -m pip install tox

- name: Run linter
run: tox -e lint

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: lint-codeclimate
path: artifacts/lint/lint-codeclimate.json
retention-days: 3
overwrite: true


34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test python package

on:
push:
paths:
- tests/**
- src/**
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install pip
run: python -m pip install -U pip

- name: Install package
run: python -m pip install -e .[dev,test]

- name: Install tox
run: python -m pip install tox

- name: Install os dependencies
run: sudo apt install -y graphviz

- name: Run tests
run: tox -e py
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Great see that you are interested in contributing to 'damast'.

To make the process as smooth as possible for all involed parties, you will find some instructions
below. In case there is some information missing, or you feel lost, do not
hesitate to ask or [open an issue](https://gitlab.com/simula-srl/damast/-/issues/new)
hesitate to ask or [open an issue](https://github.com/simula/damast/issues/new)
on this project.

## Installation
Expand Down Expand Up @@ -65,7 +65,7 @@ to run a particular test case (-k) and redirecting the output to stdout (-s).
## Merge Requests

Please fork the repository and push your code change into a branch.
Then create a [new merge request](https://gitlab.com/simula-srl/damast/-/merge_requests/new) from this branch.
Then create a new merge request from this branch.

Generally, read through the documentation first to understand the main ideas and some underlying assumptions of this project.
If you intend to change some of the behavior, please try to validate by reading the documentation or opening an issue whether
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# damast: Creation of reproducible data processing pipelines

Documentation at: https://simula-srl.gitlab.io/damast
Documentation at: https://simula.github.io/damast

## Installation and Development Setup

Expand Down Expand Up @@ -29,7 +29,7 @@ Create your venv and activate it:
Clone the repo and install:

```
git clone https://gitlab.com/simula-srl/damast
git clone https://github.com/simula/damast
cd damast
pip install -e ".[test,dev]"
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ repository = "https://gitlab.com/simula-srl/damast"

[project.optional-dependencies]
dev = [
"astroid<3",
"flake8-gl-codeclimate",
"isort",
"jupyter-book",
Expand All @@ -66,7 +67,8 @@ dev = [
test = [
"coverage",
"pytest",
"pytest-cov"
"pytest-cov",
"pydot"
]

[project.scripts]
Expand Down
2 changes: 2 additions & 0 deletions src/damast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Main module"""

from damast import cli, core, data_handling, domains
from damast.core import artifacts, describe, input, output

Expand Down
10 changes: 8 additions & 2 deletions src/damast/data_handling/exploration.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ def plot_lat_lon(*,
:return: Path to the file
"""

plt.scatter(x=df[longitude_name].evaluate(),
y=df[latitude_name].evaluate(),
longitude = df[longitude_name].evaluate()
latitude = df[latitude_name].evaluate()

# .copy() to address ValueError: assignment destination is read-only
# raised in numpy/ma/core.py:3528: in mask
# self.__setmask__(value)
plt.scatter(x=longitude.copy(),
y=latitude.copy(),
alpha=1)
plt.xlim(-180, 180)
plt.ylim(-90, 90)
Expand Down

0 comments on commit b58e212

Please sign in to comment.