From 12b8ec28bf2cc1b8568198e6e36f23e8ce6686ad Mon Sep 17 00:00:00 2001 From: Michael Wayne Goodman Date: Thu, 3 Mar 2016 12:08:41 -0800 Subject: [PATCH] Release v0.4.0 --- CHANGELOG.md | 71 +++++++++++++++++++++++++++++++++++--- README.md | 48 +++++++++++++++++--------- delphin/__about__.py | 17 +++++++++ delphin/codecs/__init__.py | 2 +- setup.py | 33 +++++++++++++----- tox.ini | 13 +++++++ 6 files changed, 154 insertions(+), 30 deletions(-) create mode 100644 delphin/__about__.py create mode 100644 tox.ini diff --git a/CHANGELOG.md b/CHANGELOG.md index 6282db69..96a3538c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,67 @@ ## [Unreleased][unreleased] +## [v0.4.0][] + +This release fixes a number of bugs (including fixes from two new +contributors; see the [README][]), and adds some minor features: + +* more convenient introspection of TDL lists +* a LaTeX exporter for DMRS + +From [v0.4.0][], pyDelphin uses [semantic versioning](http://semver.org/), +and is available on [PyPI](https://pypi.python.org/pypi/pyDelphin). + +This release also drops support for Python 2.6 (Python 2.7 is still +supported and tested). + +### Added + +* `delphin.extra.latex` is added for exporting to LaTeX; currently + contains DMRS export via `dmrs_tikz_dependency()` +* TdlConsList and TdlDiffList classes are added, which make working + with list structures in TDL more convenient; e.g., the `values()` + function returns a Python list of the elements (instead of having + to get them via `REST.REST.FIRST`, etc.) + +### Removed + +* Python2.6 support +* unused top-level util.py + +### Fixed + +* `Xmrs.subgraph()` no longer crashes when selecting only the top node +* allow hyphens in long-style variable sorts (e.g. `ref-ind2`) +* `dmrx.loads()` no longer fails for Python2 +* DMRS->MRS conversion no longer generates invalid labels for + transitive `*/EQ` links in particular orders +* MrsPath walks don't no longer cross `/EQ` links twice +* fix a bug in compound `ARG&ARG2` connectors in MrsPath + +### Changed + +* `delphin.mrs.simplemrs` + - uppercase variable property names + - don't print top-level `<-1:-1>` Lnk values for SimpleMRS 1.1 + - normalize case for other features and role names +* EPs in Xmrs are stored as ElementaryPredication objects instead of + plain tuples (with no significant drop in performance) +* VarGenerator uses next unused vid instead of next in sequence (i.e. + it fills in gaps) +* `delphin.mrs.components.Pred` + - comparison is now case-insensitive + - characters like `<` are now allowed inside a pred + - don't allow the invalid `_relation` suffix, and pretend the `_rel` + suffix is there if it isn't +* `ElementaryPredication.is_quantifier()` looks for the `RSTR` role; + Pred and Node still look for a `q` POS, since they don't have access + to the arguments/links +* added `__contains__()` method to TypedFeatureStructure to check for + the presence of features +* TDL parsing treats strings as primitives instead of as the supertype + of some TypedFeatureStructure + ## [v0.3][] This release simplifies the pyDelphin core classes and improves @@ -136,8 +197,10 @@ tests for pyDelphin. There was no CHANGELOG file prior to this release, so I don't have much information about changes, except for -[commit messages](https://github.com/goodmami/pydelphin/commits/v0.2). +[commit messages](../../commits/v0.2). -[unreleased]: https://github.com/goodmami/pydelphin/tree/develop -[v0.3]: https://github.com/goodmami/pydelphin/releases/tag/v0.3 -[v0.2]: https://github.com/goodmami/pydelphin/releases/tag/v0.2 +[unreleased]: ../../tree/develop +[v0.4.0]: ../../releases/tag/v0.4.0 +[v0.3]: ../../releases/tag/v0.3 +[v0.2]: ../../releases/tag/v0.2 +[README]: README.md diff --git a/README.md b/README.md index a6ab53f8..5ad4bc41 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # pyDelphin
Python libraries for DELPH-IN -> NOTE for previous pyDelphin users: The latest version (0.3) has some -> backward-**incompatible** changes that may break your code. The -> upgrade path shouldn't be difficult (contact me if there's trouble), -> and the changes bring big performance gains, so I think it's worth -> it. Sorry for the trouble while the API stabilizes. -> -> Also note that the primary repo for pyDelphin is now -> https://github.com/delph-in/pydelphin +> NOTE for previous pyDelphin users: Recent versions of pyDelphin may +> have backwards-incompatible changes with prior versions. Please +> [file an issue](https://github.com/delph-in/pydelphin/issues) if you +> have trouble upgrading. pyDelphin is a set of Python libraries for the processing of [DELPH-IN](http://delph-in.net) data. It doesn't aim to @@ -108,15 +104,21 @@ And here's how to compile, parse, and generate with the ACE wrapper: ## Installation and Requirements pyDelphin is developed for [Python 3](http://python.org/download/) -(3.3+), but it has also been tested to work with Python 2.7. The -[Pygments](http://pygments.org/) package is required for TDL and -SimpleMRS syntax highlighting, and -[NetworkX](http://networkx.github.io/) is required for isomorphism -checking. - -pyDelphin does not need to be installed to be used. You can -adjust `PYTHONPATH` to include the pyDelphin directory, or copy the -`delphin/` subdirectory into your project's main directory. +(3.3+), but it has also been tested to work with Python 2.7. Optional +requirements include: + - [NetworkX](http://networkx.github.io/) for MRS isomorphism + checking + - [Pygments](http://pygments.org/) for TDL and SimpleMRS syntax + highlighting + - [tikz-dependency](https://www.ctan.org/pkg/tikz-dependency), while + not a Python requirement, is needed for compiling LaTeX documents + using exported DMRSs + +pyDelphin itself does not need to be installed to be used. You can +[adjust `PYTHONPATH`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH) +to include the pyDelphin directory, or copy the `delphin/` +subdirectory into your project's main directory (but in this latter +case be aware of licensing requirements). If you want to have the `delphin` packages generally available for importing, you can use the provided `setup.py` script to install (you @@ -142,6 +144,7 @@ The following packages/modules are available: - `tfs`: Typed-Feature Structures - `extra.highlight`: [Pygments](http://pygments.org/)-based syntax highlighting (currently just for TDL and SimpleMRS) +- `extra.latex`: Formatting for LaTeX (just DMRS) - `interfaces.ace`: Python wrapper for common tasks using [ACE](http://sweaglesw.org/linguistics/ace/) @@ -149,3 +152,14 @@ The following packages/modules are available: - [Michael Wayne Goodman](https://github.com/goodmami/) (primary author) - [T.J. Trimble](https://github.com/dantiston/) (packaging, derivations, ACE) +- [Guy Emerson](https://github.com/guyemerson/) (MRS) +- [Alex Kuhnle](https://github.com/AlexKuhnle/) (MRS) + +## Related Software + +- https://github.com/wpm/Ruby-DELPH-IN +- https://github.com/ned2/typediff +- Also, on the DELPH-IN wiki: + - http://moin.delph-in.net/ + - http://moin.delph-in.net/ToolsTop + - http://moin.delph-in.net/DelphinApplications diff --git a/delphin/__about__.py b/delphin/__about__.py new file mode 100644 index 00000000..514ca579 --- /dev/null +++ b/delphin/__about__.py @@ -0,0 +1,17 @@ + +# This __about__.py file for storing project metadata is inspired by +# the warehouse project: +# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py + +__version__ = '0.4.0' +__version_info__ = __version__.replace('.', ' ').replace('-', ' ').split() + +__title__ = 'pyDelphin' +__summary__ = 'Libraries and scripts for DELPH-IN data' +__uri__ = 'https://github.com/delph-in/pydelphin' + +__author__ = 'Michael Wayne Goodman' +__email__ = 'goodman.m.w@gmail.com' + +__license__ = 'MIT' +__copyright__ = '2013 %s <%s> and contributors' % (__author__, __email__) diff --git a/delphin/codecs/__init__.py b/delphin/codecs/__init__.py index 85991b95..48b37edd 100644 --- a/delphin/codecs/__init__.py +++ b/delphin/codecs/__init__.py @@ -9,4 +9,4 @@ DeprecationWarning ) -from delphin.mrs import simplemrs, mrx, dmrx \ No newline at end of file +from delphin.mrs import simplemrs, mrx, dmrx diff --git a/setup.py b/setup.py index 7537f2b8..096403bd 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import sys +import os from setuptools import setup from setuptools.command.test import test as TestCommand @@ -31,15 +32,29 @@ def initialize_options(self): '--cov-report=html' ] +long_description = '''\ +pyDelphin provides a suite of libraries for modeling Minimal Recursion +Semantics (MRS; including DMRS), derivation trees, and [incr tsdb()] +profiles; introspection tools for Type Description Language (TDL), +which is used to define HPSG grammars; a Python wrapper for the ACE +parser; and some extra tools for syntax highlighting or LaTeX output. +Python developers who work with DELPH-IN data can rely on pyDelphin to +correctly deal with such data via convenient interfaces.''' + +base_dir = os.path.dirname(__file__) +about = {} +with open(os.path.join(base_dir, "delphin", "__about__.py")) as f: + exec(f.read(), about) setup( - name='pyDelphin', - version='0.3', - url='https://github.com/delph-in/pydelphin', - author='Michael Wayne Goodman', - author_email='goodman.m.w@gmail.com', - description='Libraries and scripts for DELPH-IN data.', - license='MIT', + name=about['__title__'], + version=about['__version__'], + description=about['__summary__'], + long_description=long_description, + url=about['__uri__'], + author=about['__author__'], + author_email=about['__email__'], + license=about['__license__'], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', @@ -52,6 +67,7 @@ def initialize_options(self): 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Topic :: Scientific/Engineering :: Information Analysis', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Text Processing :: Linguistic', @@ -60,10 +76,11 @@ def initialize_options(self): keywords='nlp semantics hpsg delph-in', packages=[ 'delphin', + 'delphin.lib', 'delphin.interfaces', 'delphin.mrs', 'delphin.extra', - 'delphin.codecs', + 'delphin.codecs' ], install_requires=[ 'networkx', diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..ea341623 --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +# Tox (http://tox.testrun.org/) is a tool for running tests +# in multiple virtualenvs. This configuration file will run the +# test suite on all supported python versions. To use it, "pip install tox" +# and then run "tox" from this directory. + +[tox] +envlist = py27, py33, py34, py35 + +[testenv] +commands = {envpython} setup.py test +deps = + pytest + networkx