Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
* Added: Support for PROV-O (RDF) serialization and deserialization
* Added: `direction` option for `prov.dot.prov_to_dot`
* Added: `prov.graph.graph_to_prov` to convert a Networkx graph back to a `ProvDocument`
* Testing with Python 3.5
* Various minor bug fixes and improvements
  • Loading branch information
trungdong committed Oct 19, 2016
1 parent 34cdfce commit bab9ba3
Show file tree
Hide file tree
Showing 14 changed files with 66 additions and 40 deletions.
4 changes: 2 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Development Lead
Contributors
------------

* Sam Millar
* Satrajit Ghosh
* Satrajit Ghosh (:py:mod:`prov.serializers.provrdf` module)
* Lion Krischer (:py:mod:`prov.serializers.provxml` module and Python 3 support)
* Sam Millar
16 changes: 7 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ If you are reporting a bug, please include:
Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.
Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_ for bugs.
Anything tagged with "bug" is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.
Look through the GitHub `issues <https://github.com/trungdong/prov/issues>`_
for features. Anything tagged with "feature" is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -66,7 +66,7 @@ Ready to contribute? Here's how to set up `prov` for local development.

$ mkvirtualenv prov
$ cd prov/
$ python setup.py develop
$ pip install -r requirements-dev.txt

4. Create a branch for local development::

Expand All @@ -80,8 +80,6 @@ Ready to contribute? Here's how to set up `prov` for local development.
$ python setup.py test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

$ git add .
Expand All @@ -99,10 +97,10 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4, and for PyPy.
3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5, and for PyPy.
Check https://travis-ci.org/trungdong/prov/pull_requests
and make sure that the tests pass for all supported Python versions.
(See [pyenv](https://github.com/yyuu/pyenv) for help on setting up
(See `pyenv <https://github.com/yyuu/pyenv>`_ for help on setting up
multiple versions of Python locally for testing.)

Tips
Expand Down
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
History
-------

1.5.0 (2015-10-19)
^^^^^^^^^^^^^^^^^^
* Added: Support for `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF) serialization and deserialization
* Added: `direction` option for :py:meth:`prov.dot.prov_to_dot`
* Added: :py:meth:`prov.graph.graph_to_prov` to convert a `MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ back to a :py:class:`~prov.model.ProvDocument`
* Testing with Python 3.5
* Various minor bug fixes and improvements

1.4.0 (2015-08-13)
^^^^^^^^^^^^^^^^^^
* Changed the type of qualified names to prov:QUALIFIED_NAME (fixed #68)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 University of Southampton
Copyright (c) 2014–2016 University of Southampton

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ include README.rst
include CHANGES.txt
include prov/tests/json/*.json
include prov/tests/unification/*.json
include prov/tests/rdf/*.ttl
include prov/tests/rdf/*.trig
include prov/tests/xml/*.xml

recursive-exclude * __pycache__
Expand Down
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ Introduction
:alt: License


A library for W3C Provenance Data Model supporting PROV-JSON and PROV-XML import/export
A library for W3C Provenance Data Model supporting PROV-O (RDF), PROV-XML, PROV-JSON import/export

* Free software: MIT license
* Documentation: http://prov.readthedocs.org.
* Documentation: http://prov.readthedocs.io/.

Features
--------

* An implementation of the `W3C PROV Data Model <http://www.w3.org/TR/prov-dm/>`_ in Python.
* In-memory classes for PROV assertions, which can then be output as `PROV-N <http://www.w3.org/TR/prov-n/>`_
* Serialization and deserializtion support: `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_ and `PROV-XML <http://www.w3.org/TR/prov-xml/>`_.
* Serialization and deserializtion support: `PROV-O <http://www.w3.org/TR/prov-o/>`_ (RDF), `PROV-XML <http://www.w3.org/TR/prov-xml/>`_ and `PROV-JSON <http://www.w3.org/Submission/prov-json/>`_.
* Exporting PROV documents into various graphical formats (e.g. PDF, PNG, SVG).
* Convert a PROV document to a `Networkx MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_ and back.


Uses
Expand Down
8 changes: 8 additions & 0 deletions docs/prov.serializers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ prov.serializers.provn module
:show-inheritance:


prov.serializers.provrdf module
-------------------------------

.. automodule:: prov.serializers.provrdf
:members:
:show-inheritance:


prov.serializers.provxml module
-------------------------------

Expand Down
2 changes: 1 addition & 1 deletion prov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

__author__ = 'Trung Dong Huynh'
__email__ = 'trungdong@donggiang.com'
__version__ = '1.4.1.dev1'
__version__ = '1.5.0'

__all__ = ["Error", "model", "read"]

Expand Down
10 changes: 4 additions & 6 deletions prov/dot.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Graphical visualisation support for prov.model.
This module produces graphical visualisation for provenanve graphs.
Requires pydot module and Graphviz.
Requires pydotplus module and Graphviz.
References:
* pydot Homepage: http://code.google.com/p/pydot/
* pydotplus homepage: http://pydotplus.readthedocs.io/
* Graphviz: http://www.graphviz.org/
* DOT Language: http://www.graphviz.org/doc/info/lang.html
Expand Down Expand Up @@ -148,11 +148,9 @@ def prov_to_dot(bundle, show_nary=True, use_labels=False,
:type name: :class:`ProvBundle`
:param show_nary: shows all elements in n-ary relations.
:type show_nary: bool
:param use_labels: uses the prov:label property of an element as its name
(instead of its identifier).
:param use_labels: uses the prov:label property of an element as its name (instead of its identifier).
:type use_labels: bool
:param direction: specifies the direction of the graph. Valid values are
"BT" (default), "TB", "LR", "RL".
:param direction: specifies the direction of the graph. Valid values are "BT" (default), "TB", "LR", "RL".
:param show_element_attributes: shows attributes of elements.
:type show_element_attributes: bool
:param show_relation_attributes: shows attributes of relations.
Expand Down
8 changes: 6 additions & 2 deletions prov/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def prov_to_graph(prov_document):
<http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_
instance of the `NetworkX <https://networkx.github.io/>`_ library.
:param prov_document: The :class:`~prov.model.ProvDocument` instance to
convert.
:param prov_document: The :class:`~prov.model.ProvDocument` instance to convert.
"""
g = nx.MultiDiGraph()
unified = prov_document.unified()
Expand Down Expand Up @@ -63,6 +62,11 @@ def prov_to_graph(prov_document):


def graph_to_prov(g):
""" Convert a `MultiDiGraph <http://networkx.github.io/documentation/latest/reference/classes.multidigraph.html>`_
back to a :class:`~prov.model.ProvDocument`.
:param g: The graph instance to convert.
"""
prov_doc = ProvDocument()
for n in g.nodes_iter():
if isinstance(n, ProvRecord) and n.bundle is not None:
Expand Down
6 changes: 6 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-r requirements.txt
coverage
flake8
sphinx
tox
wheel
12 changes: 6 additions & 6 deletions scripts/prov-compare
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env python
# encoding: utf-8
"""
prov-compare -- Compare two PROV-JSON or PROV-XML files for equivalence
prov-compare -- Compare two PROV-JSON, PROV-XML, or RDF (PROV-O) files for equivalence
@author: Trung Dong Huynh
@copyright: 2015 University of Southampton, United Kingdom. All rights reserved.
@copyright: 2016 University of Southampton, United Kingdom. All rights reserved.
@license: TBD
@license: MIT Licence
@contact: trungdong@donggiang.com
@deffield updated: 2015-06-16
@deffield updated: 2016-10-19
"""

from argparse import ArgumentParser, RawDescriptionHelpFormatter, FileType
Expand All @@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
__all__ = []
__version__ = 0.1
__date__ = '2015-06-16'
__updated__ = '2015-06-16'
__updated__ = '2016-10-19'

DEBUG = 0
TESTRUN = 0
Expand Down Expand Up @@ -62,7 +62,7 @@ def main(argv=None): # IGNORE:C0111
program_license = '''%s
Created by Trung Dong Huynh on %s.
Copyright 2015 University of Southampton. All rights reserved.
Copyright 2016 University of Southampton. All rights reserved.
Licensed under the MIT License
https://github.com/trungdong/prov/blob/master/LICENSE
Expand Down
16 changes: 8 additions & 8 deletions scripts/prov-convert
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env python
# encoding: utf-8
"""
convert -- Convert PROV-JSON to PROV-N, PROV-XML, or graphical formats (SVG, PDF, PNG)
convert -- Convert PROV-JSON to RDF, PROV-N, PROV-XML, or graphical formats (SVG, PDF, PNG)
@author: Trung Dong Huynh
@copyright: 2015 University of Southampton, United Kingdom. All rights reserved.
@copyright: 2016 University of Southampton, United Kingdom. All rights reserved.
@license: TBD
@license: MIT License
@contact: trungdong@donggiang.com
@deffield updated: 2014-03-14
@deffield updated: 2016-10-19
"""

from argparse import ArgumentParser, RawDescriptionHelpFormatter, FileType
Expand All @@ -29,17 +29,17 @@ logger = logging.getLogger(__name__)
__all__ = []
__version__ = 0.1
__date__ = '2014-03-14'
__updated__ = '2015-02-03'
__updated__ = '2016-10-19'

DEBUG = 0
TESTRUN = 0
PROFILE = 0

GRAPHVIZ_SUPPORTED_FORMATS = set([
GRAPHVIZ_SUPPORTED_FORMATS = {
'bmp', 'canon', 'cmap', 'cmapx', 'cmapx_np', 'dot', 'eps', 'fig', 'gtk', 'gv', 'ico', 'imap', 'imap_np', 'ismap',
'jpe', 'jpeg', 'jpg', 'pdf', 'plain', 'plain-ext', 'png', 'ps', 'ps2', 'svg', 'svgz', 'tif', 'tiff', 'tk',
'vml', 'vmlz', 'x11', 'xdot', 'xlib'
])
}


@six.python_2_unicode_compatible
Expand Down Expand Up @@ -88,7 +88,7 @@ def main(argv=None): # IGNORE:C0111
program_license = '''%s
Created by Trung Dong Huynh on %s.
Copyright 2015 University of Southampton. All rights reserved.
Copyright 2016 University of Southampton. All rights reserved.
Licensed under the MIT License
https://github.com/trungdong/prov/blob/master/LICENSE
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

setup(
name='prov',
version='1.4.1.dev1',
version='1.5.0',
description='A library for W3C Provenance Data Model supporting PROV-JSON, '
'PROV-XML and PROV-O',
'PROV-XML and PROV-O (RDF)',
long_description=readme + '\n\n' + history,
author='Trung Dong Huynh',
author_email='trungdong@donggiang.com',
Expand Down Expand Up @@ -59,6 +59,7 @@
"Programming Language :: Python :: 3",
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
'Topic :: Scientific/Engineering :: Information Analysis',
Expand Down

0 comments on commit bab9ba3

Please sign in to comment.