Commit be81c1c0 authored by julian.gethmann's avatar julian.gethmann

Add artifacts and fix tslib deprecation

parent fcc910d8
......@@ -61,6 +61,11 @@ docs:
- pip install Sphinx
script:
- python setup.py docs
artifacts:
paths:
- public
only:
- tags
# This deploy job uses a simple deploy flow to Heroku, other providers, e.g. AWS Elastic Beanstalk
# are supported too: https://github.com/travis-ci/dpl
......@@ -68,5 +73,5 @@ docs:
# type: deploy
# environment: production
# script:
# - python setup.py
# - python setup.py
# - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_PRODUCTION_KEY
......@@ -8,7 +8,7 @@ Changelog
------------------
* remove not implemented argument `show_url` of `dump_cassandra_data()`
* write tests that are independent of access to the IBPT network
* move directory structure to new one (cassandra->src/cassandra) to complete `PyScaffold` structure
* move directory structure to new one (`cassandra`->`src/cassandra`) to complete `PyScaffold` structure
* Upgrade PyScaffold to be compatible with new setuptools versions
0.7.1 (2017-10-31)
......
......@@ -5,7 +5,7 @@
Contributing
============
Contributions are welcome, and they are greatly appreciated!
Contributions are welcome, and they are greatly appreciated!
You can contribute in many ways:
......@@ -15,7 +15,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~
Report bugs at https://git.scc.kit.edu/las/py/cassandra/issues.
Report bugs at https://git.scc.kit.edu/las-software/15-3-DataProcessing/cassandra/issues.
If you are reporting a bug, please include:
......@@ -40,14 +40,16 @@ Write Documentation
~~~~~~~~~~~~~~~~~~~
cassandra could always use more documentation, whether as part of the
official cassandra docs, in docstrings.
official cassandra docs, in docstrings or the examples.
The documentation is generated automatically using `Sphinx docs`_ with the napoleon extension.
So please write your docstrings following `Google's docstring convention`_.
So please write your docstrings following `Google's docstring convention`_.
.. _`Sphinx docs`: http://www.sphinx-doc.org
.. _`Google's docstring convention`: http://www.sphinx-doc.org/en/stable/ext/example_google.html?highlight=napoleon
Since Sphinx does not handle Python 2's type annotations (`PEP 484 <https://www.python.org/dev/peps/pep-0484/#suggested-syntax-for-python-2-7-and-straddling-code>`_) well, it is still necessary to write the type in the docstring.
Write Tests
~~~~~~~~~~~
......@@ -56,7 +58,7 @@ Try to increase the test coverage by writing tests.
Submit Feedback
~~~~~~~~~~~~~~~
The best way to send feedback is to file an issue at https://git.scc.kit.edu/las/py/cassandra/issues.
The best way to send feedback is to file an issue at https://git.scc.kit.edu/las-software/15-3-DataProcessing/cassandra/issues.
If you are proposing a feature:
......@@ -75,12 +77,13 @@ Ready to contribute? Here's how to set up `cassandra` for local development.
$ git clone git@git.scc.kit.edu/YOURNAME/cassandra.git
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Install your local copy into a virtualenv or venv, which ships with Python 3::
$ mkvirtualenv cassandra
$ cd cassandra/
$ python3 -m venv .venv
$ source .venv/bin/activate
$ python setup.py develop
$ python -m pip install -r test-requirements.txt
$ python -m pip install -r test-requirements.txt -r requirements.txt
4. Create a branch for local development::
......@@ -96,10 +99,12 @@ Ready to contribute? Here's how to set up `cassandra` for local development.
To get flake8 and tox, just pip install them into your virtualenv.
Change things marked by the pre-commit-hooks if there are some.
6. Check for upstream updates::
$ git remote add upstream https://git.scc.kit.edu/las/py/cassandra.git
$ git fetch upstream
$ git remote add upstream https://git.scc.kit.edu/las-software/15-3-DataProcessing/cassandra.git
$ git fetch upstream
$ git checkout master
$ git merge upstream/master
$ git checkout name-of-your-bugfix-or-feature
......@@ -121,14 +126,15 @@ Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
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.7, 3.4, 3.5 and 3.6, and for possibly PyPy and other versions.
feature to the list in README.rst and CHANGELOG.rst.
3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6, and possibly PyPy and other versions.
Tips
----
..
Tips
----
Try to increase the test coverage. You can check the coverage by running
Try to increase the test coverage. You can check the coverage by running
$ make cov
$ make cov
and opening the `htmlcov/index.html` file.
and opening the `htmlcov/index.html` file.
......@@ -64,7 +64,7 @@ You can compile the docu either by using the setup.py::
or by hand by running::
$ cd docs && sphinx-apidoc -f -o ./_source ../cassandra
$ cd docs && sphinx-apidoc -f -o ./_source ../src/cassandra
including filenames (ls `*.rst >> index.rst`) into `index.rst` at a appropriate place and add three spaces before them (e.\,g. care about the indention!)
and finally by running::
......@@ -87,7 +87,9 @@ create the docs directory and initialize the project::
$ mkdir docs
$ cd docs
$ sphinx-quickstart (project path: ../cassandra, source-build seperated)
$ sphinx-quickstart (project path: ../src/cassandra, source-build seperated)
configure it by editing `source/conf.py` and adding `shpinx.ext.napoleon` to the list of extensions and
uncommenting `import sys` and `import os` and modifying `abspath('../..')`.
Create some required directories `mkdir _source _static`.
......@@ -8,10 +8,10 @@ Contents
:maxdepth: 2
Examples <examples>
Module Reference <api/cassandra>
Changelog <changelog>
License <license>
Authors <authors>
Changelog <changelog>
Module Reference <api/modules>
Contributing <contributing>
......
......@@ -127,18 +127,15 @@ class CssreadTestCase(unittest.TestCase):
self.assertIsInstance(res_np, np.ndarray)
self.assertIsInstance(res_pd, pd.DataFrame)
self.assertEqual(res_np["Time"][0], datetime(2016, 2, 15, 11, 15))
self.assertEqual(res_pd.index[0].to_pydatetime(),
datetime(2016, 2, 15, 11, 15))
self.assertIsInstance(res_pd.index[0], pd.tslib.Timestamp)
self.assertEqual(res_pd.index[0].to_pydatetime(), datetime(2016, 2, 15, 11, 15))
self.assertIsInstance(res_pd.index[0], pd.Timestamp)
res_pd_nodrop = cassandra.css_read.load_css_data(
self.tmpfile, "pd", dropna=False)
res_pd_nodrop = cassandra.css_read.load_css_data(self.tmpfile, "pd", dropna=False)
self.assertIsInstance(res_pd_nodrop, pd.DataFrame)
self.assertEqual(res_pd_nodrop.dropna().index[0].to_pydatetime(),
datetime(2016, 2, 15, 11, 15))
self.assertEqual(res_pd_nodrop.index[0].to_pydatetime(),
datetime(2016, 2, 12, 16, 55))
self.assertIsInstance(res_pd_nodrop.index[0], pd.tslib.Timestamp)
self.assertEqual(res_pd_nodrop.index[0].to_pydatetime(), datetime(2016, 2, 12, 16, 55))
self.assertIsInstance(res_pd_nodrop.index[0], pd.Timestamp)
with self.assertRaises(ValueError):
cassandra.css_read.load_css_data(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment