Skip to content

Commit 377c1e2

Browse files
committed
rename to mona, start versioning from 0.1
1 parent ce758dc commit 377c1e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+117
-120
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
# Caf
2-
3-
[![build](https://img.shields.io/travis/azag0/calcfw/master.svg)](https://travis-ci.org/azag0/calcfw)
4-
[![coverage](https://img.shields.io/codecov/c/github/azag0/calcfw.svg)](https://codecov.io/gh/azag0/calcfw)
5-
![python](https://img.shields.io/pypi/pyversions/calcfw.svg)
6-
[![pypi](https://img.shields.io/pypi/v/calcfw.svg)](https://pypi.org/project/calcfw/)
7-
[![commits since](https://img.shields.io/github/commits-since/azag0/calcfw/latest.svg)](https://github.com/azag0/calcfw/releases)
8-
[![last commit](https://img.shields.io/github/last-commit/azag0/calcfw.svg)](https://github.com/azag0/calcfw/commits/master)
9-
[![license](https://img.shields.io/github/license/azag0/calcfw.svg)](https://github.com/azag0/calcfw/blob/master/LICENSE)
1+
# Mona
2+
3+
[![build](https://img.shields.io/travis/azag0/mona/master.svg)](https://travis-ci.org/azag0/mona)
4+
[![coverage](https://img.shields.io/codecov/c/github/azag0/mona.svg)](https://codecov.io/gh/azag0/mona)
5+
![python](https://img.shields.io/pypi/pyversions/mona.svg)
6+
[![pypi](https://img.shields.io/pypi/v/mona.svg)](https://pypi.org/project/mona/)
7+
[![commits since](https://img.shields.io/github/commits-since/azag0/mona/latest.svg)](https://github.com/azag0/mona/releases)
8+
[![last commit](https://img.shields.io/github/last-commit/azag0/mona.svg)](https://github.com/azag0/mona/commits/master)
9+
[![license](https://img.shields.io/github/license/azag0/mona.svg)](https://github.com/azag0/mona/blob/master/LICENSE)
1010
[![code style](https://img.shields.io/badge/code%20style-black-202020.svg)](https://github.com/ambv/black)
1111

12-
Caf is a distributed calculation framework that turns normal execution of Python functions into a graph of tasks. Each task is hashed by the code of its function and its inputs, and the result of each executed task is cached. The cache can be stored persistently in an SQLite database. Tasks and their results can be exchanged between different machines via SSH.
12+
Mona is a distributed calculation framework that turns normal execution of Python functions into a graph of tasks. Each task is hashed by the code of its function and its inputs, and the result of each executed task is cached. The cache can be stored persistently in an SQLite database. Tasks and their results can be exchanged between different machines via SSH.
1313

1414
## Installing
1515

1616
Install and update using [Pip](https://pip.pypa.io/en/stable/quickstart/).
1717

1818
```
19-
pip install -U calcfw
19+
pip install -U mona
2020
```
2121

2222
## Links
2323

24-
- Documentation: https://azag0.github.io/calcfw
24+
- Documentation: https://azag0.github.io/mona
2525

2626
## A simple example
2727

2828
```python
29-
import caf
29+
from mona import Rule, Session
3030

31-
@caf.Rule
31+
@Rule
3232
async def total(xs):
3333
return sum(xs)
3434

35-
@caf.Rule
35+
@Rule
3636
async def fib(n):
3737
if n < 2:
3838
return n
3939
return total([fib(n - 1), fib(n - 2)])
4040

41-
with caf.Session() as sess:
41+
with Session() as sess:
4242
sess.eval(fib(5))
4343
dot = sess.dot_graph()
44-
dot.render('fib.gv', view=True, format='svg')
44+
dot.render(view=True)
4545
```
4646

47-
![](https://raw.githubusercontent.com/azag0/calcfw/master/docs/fib.gv.svg?sanitize=true)
47+
![](https://raw.githubusercontent.com/azag0/mona/master/docs/fib.gv.svg?sanitize=true)
4848

docs/api.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ API
44
Rules and Sessions
55
------------------
66

7-
.. module:: caf
7+
.. module:: mona
88

99
.. autoclass:: Rule
1010
:members:
@@ -22,7 +22,7 @@ Rules and Sessions
2222
:members:
2323

2424

25-
.. module:: caf.rules
25+
.. module:: mona.rules
2626

2727
Directory tasks
2828
---------------
@@ -38,7 +38,7 @@ Scientific calculations
3838
Molecular and crystal geometries
3939
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4040

41-
.. module:: caf.sci.geomlib
41+
.. module:: mona.sci.geomlib
4242

4343
.. autoclass:: Atom
4444
:members:
@@ -58,7 +58,7 @@ Molecular and crystal geometries
5858
FHI-aims
5959
^^^^^^^^
6060

61-
.. module:: caf.sci.aims
61+
.. module:: mona.sci.aims
6262

6363
.. autoclass:: Aims
6464
:members:
@@ -72,21 +72,21 @@ Futures and Tasks
7272
The following classes are not intended for direct use by the end user, but are
7373
part of the versioned public API neverthless.
7474

75-
.. autoclass:: caf.futures.Future
75+
.. autoclass:: mona.futures.Future
7676
:members:
7777

78-
.. autoclass:: caf.hashing.HashedComposite
78+
.. autoclass:: mona.hashing.HashedComposite
7979
:members:
8080
:inherited-members:
8181

82-
.. autoclass:: caf.tasks.Task
82+
.. autoclass:: mona.tasks.Task
8383
:members:
8484
:inherited-members:
8585

86-
.. autoclass:: caf.tasks.TaskComposite
86+
.. autoclass:: mona.tasks.TaskComposite
8787
:members:
8888
:inherited-members:
8989

90-
.. autoclass:: caf.tasks.TaskComponent
90+
.. autoclass:: mona.tasks.TaskComponent
9191
:members:
9292
:inherited-members:

docs/cli.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CLI
33

44
.. code-block:: none
55
6-
Usage: caf [OPTIONS] COMMAND [ARGS]...
6+
Usage: mona [OPTIONS] COMMAND [ARGS]...
77
88
Options:
99
--help Show this message and exit.
@@ -18,7 +18,7 @@ CLI
1818
1919
.. code-block:: none
2020
21-
Usage: caf run [OPTIONS] RULE
21+
Usage: mona run [OPTIONS] RULE
2222
2323
Run a given rule.
2424

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
with open('../pyproject.toml') as f:
1313
metadata = toml.load(f)['tool']['poetry']
1414

15-
project = 'Caf'
15+
project = 'Mona'
1616
version = metadata['version']
1717
author = ' '.join(metadata['authors'][0].split()[:-1])
1818
description = metadata['description']
@@ -37,7 +37,7 @@
3737
'description': description,
3838
'github_button': True,
3939
'github_user': 'azag0',
40-
'github_repo': 'calcfw',
40+
'github_repo': 'mona',
4141
'badge_branch': 'master',
4242
'codecov_button': True,
4343
'travis_button': True,

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Welcome to Caf
2-
==============
1+
Welcome to Mona
2+
===============
33

44
Only scaffolding of the planned documentation is available now.
55

File renamed without changes.

caf/cli/app.py renamed to mona/cli/app.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616

1717

1818
class App:
19-
CAFDIR = '.caf'
19+
MONADIR = '.mona'
2020
TMPDIR = 'tmpdir'
2121
FILES = 'files'
2222
CACHE = 'cache.db'
2323

24-
def __init__(self, cafdir: Pathable = None) -> None:
25-
cafdir = cafdir or os.environ.get('CAF_DIR') or App.CAFDIR
26-
self._cafdir = Path(cafdir).resolve()
24+
def __init__(self, monadir: Pathable = None) -> None:
25+
monadir = monadir or os.environ.get('MONA_DIR') or App.MONADIR
26+
self._monadir = Path(monadir).resolve()
2727
self._config: Dict[str, Any] = {}
2828
for path in [
29-
Path('~/.config/caf/config.toml').expanduser(),
30-
Path('caf.toml'),
31-
self._cafdir / 'config.toml',
29+
Path('~/.config/mona/config.toml').expanduser(),
30+
Path('mona.toml'),
31+
self._monadir / 'config.toml',
3232
]:
3333
if path.exists():
3434
with path.open() as f:
@@ -48,30 +48,30 @@ def __call__(
4848
) -> None:
4949
self._plugins = {
5050
'parallel': Parallel(ncores),
51-
'tmpdir': TmpdirManager(self._cafdir / App.TMPDIR),
52-
'files': FileManager(self._cafdir / App.FILES),
51+
'tmpdir': TmpdirManager(self._monadir / App.TMPDIR),
52+
'files': FileManager(self._monadir / App.FILES),
5353
'cache': Cache.from_path(
54-
self._cafdir / App.CACHE, full_restore=full_restore, readonly=readonly
54+
self._monadir / App.CACHE, full_restore=full_restore, readonly=readonly
5555
),
5656
}
5757
for plugin in self._plugins.values():
5858
plugin(sess)
5959

60-
def ensure_cafdir(self) -> None:
61-
if self._cafdir.is_dir():
62-
log.info(f'Already initialized in {self._cafdir}.')
60+
def ensure_monadir(self) -> None:
61+
if self._monadir.is_dir():
62+
log.info(f'Already initialized in {self._monadir}.')
6363
return
64-
log.info(f'Initializing an empty repository in {self._cafdir}.')
65-
self._cafdir.mkdir()
64+
log.info(f'Initializing an empty repository in {self._monadir}.')
65+
self._monadir.mkdir()
6666
try:
6767
cache_home = Path(self._config['cache'])
6868
except KeyError:
6969
for dirname in [App.TMPDIR, App.FILES]:
70-
(self._cafdir / dirname).mkdir()
70+
(self._monadir / dirname).mkdir()
7171
else:
7272
ts = get_timestamp()
7373
cachedir = cache_home / f'{Path.cwd().name}_{ts}'
7474
cachedir.mkdir()
7575
for dirname in [App.TMPDIR, App.FILES]:
7676
(cachedir / dirname).mkdir()
77-
(self._cafdir / dirname).symlink_to(cachedir / dirname)
77+
(self._monadir / dirname).symlink_to(cachedir / dirname)

caf/cli/cli.py renamed to mona/cli/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
)
2727
log = logging.getLogger(__name__)
2828
log.setLevel(logging.INFO)
29-
logging.getLogger('caf').setLevel(int(os.environ.get('CAF_DEBUG', logging.INFO)))
29+
logging.getLogger('mona').setLevel(int(os.environ.get('MONA_DEBUG', logging.INFO)))
3030

3131

3232
@click.group()
@@ -39,7 +39,7 @@ def cli(ctx: click.Context) -> None:
3939
@click.pass_obj
4040
def init(app: App) -> None:
4141
"""Initialize a Git repository."""
42-
app.ensure_cafdir()
42+
app.ensure_monadir()
4343

4444

4545
class TaskFilter:
@@ -77,7 +77,7 @@ def __call__(self, task: Task[Any], exc: Exception) -> bool:
7777
@click.option('-j', '--cores', type=int, help='Number of cores')
7878
@click.option('-l', '--limit', type=int, help='Limit number of tasks to N')
7979
@click.option('--maxerror', default=5, help='Number of errors in row to quit')
80-
@click.argument('rulename', metavar='RULE', envvar='CAF_RULE')
80+
@click.argument('rulename', metavar='RULE', envvar='MONA_RULE')
8181
@click.pass_obj
8282
def run(
8383
app: App,
@@ -103,7 +103,7 @@ def run(
103103

104104
@cli.command()
105105
@click.option('-p', '--pattern', multiple=True, help='Patterns to be reported')
106-
@click.argument('rulename', metavar='RULE', envvar='CAF_RULE')
106+
@click.argument('rulename', metavar='RULE', envvar='MONA_RULE')
107107
@click.pass_obj
108108
def status(app: App, rulename: str, pattern: List[str]) -> None:
109109
"""Print status of tasks."""
@@ -144,7 +144,7 @@ def status(app: App, rulename: str, pattern: List[str]) -> None:
144144

145145

146146
@cli.command()
147-
@click.argument('rulename', metavar='RULE', envvar='CAF_RULE')
147+
@click.argument('rulename', metavar='RULE', envvar='MONA_RULE')
148148
@click.pass_obj
149149
def graph(app: App, rulename: str) -> None:
150150
"""Open a pdf with the task graph."""
@@ -162,7 +162,7 @@ def graph(app: App, rulename: str) -> None:
162162
@click.option('-f', '--force', is_flag=True, help='Remove PATH if exists')
163163
@click.option('--done', is_flag=True, help='Check out only finished tasks')
164164
@click.option('-c', '--copy', is_flag=True, help='Copy instead of symlinking')
165-
@click.argument('rulename', metavar='RULE', envvar='CAF_RULE')
165+
@click.argument('rulename', metavar='RULE', envvar='MONA_RULE')
166166
@click.pass_obj
167167
def checkout(
168168
app: App,
File renamed without changes.

0 commit comments

Comments
 (0)