Skip to content

Commit

Permalink
Merge pull request #454 from Andrew-S-Rosen/patch-3
Browse files Browse the repository at this point in the history
JOSS Paper: Reduce line-spacing in code blocks
  • Loading branch information
janosh authored Oct 15, 2023
2 parents e062ecc + d178f63 commit 9d9dcc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ jobs:
cache: pip
cache-dependency-path: pyproject.toml

- uses: pre-commit/[email protected]
- name: Run pre-commit
run: |
pip install pre-commit
pre-commit run --all-files --show-diff-on-failure
test:
services:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
hooks:
- id: blacken-docs
additional_dependencies: [black]
exclude: README.md
exclude: ^(README.md|paper/paper.md)$
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
Expand Down
9 changes: 0 additions & 9 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,14 @@ As a simple demonstration, the example below shows how one can construct a simpl
```python
from jobflow import Flow, job, run_locally


@job
def add(a, b):
return a + b


@job
def multiply(a, b):
return a * b


job1 = add(1, 2) # 1 + 2 = 3
job2 = multiply(job1.output, 3) # 3 * 3 = 9
flow = Flow([job1, job2])
Expand All @@ -128,23 +125,19 @@ Beyond the typical acyclic graph of jobs, Jobflow fully supports dynamic workflo
from random import randint
from jobflow import Flow, Response, job, run_locally


@job
def add(a, b):
return a + b


@job
def make_list(val):
return [val] * randint(2, 6)


@job
def add_distributed(vals, c):
jobs = [add(val, c) for val in vals]
return Response(replace=Flow(jobs))


job1 = add(1, 2) # 1 + 2 = 3
job2 = make_list(job1.output) # e.g., [3, 3, 3]
job3 = add_distributed(job2.output, 10) # [3 + 10, 3 + 10, 3 + 10]
Expand All @@ -168,7 +161,6 @@ from dataclasses import dataclass
from jobflow import job, Flow, Maker
from jobflow.managers.local import run_locally


@dataclass
class ExponentiateMaker(Maker):
name: str = "Exponentiate"
Expand All @@ -178,7 +170,6 @@ class ExponentiateMaker(Maker):
def make(self, a):
return a**self.exponent


job1 = ExponentiateMaker().make(a=2) # 2**2 = 4
job2 = ExponentiateMaker(exponent=3).make(job1.output) # 4**3 = 64
flow = Flow([job1, job2])
Expand Down

0 comments on commit 9d9dcc7

Please sign in to comment.