Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add citation information #99

Merged
merged 9 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ data:
documentation:
- '.github/workflows/docs.yml'
- docs/**/*
- README.rst
- README.md

morpher:
- src/data_morph/morpher.py

packaging:
- pyproject.toml
- README.rst
- CITATION.cff
- LICENSE
- pyproject.toml
- README.md
- src/data_morph/__init__.py

plotting:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/citation-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow checks that the CITATION.cff file is valid, if it is included in the PR.
#
# Author: Stefanie Molin

name: Validate CITATION.cff

on:
pull_request:
paths:
- 'CITATION.cff'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
# check that the CITATION.cff configuration is valid
citation:
runs-on: ubuntu-latest
name: Validate CITATION.cff
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install cffconvert
run: pip install cffconvert
- name: Validate
run: |
verdict=$(cffconvert --validate)
echo $verdict
if [[ $verdict != "Citation metadata are valid"* ]]; then
exit 1
fi
25 changes: 25 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit edit via form.

cff-version: 1.2.0
title: 'stefmolin/data-morph: Data Morph'
message: 'If you use this software, please cite it as below.'
type: software
authors:
- family-names: Molin
given-names: Stefanie
orcid: 'https://orcid.org/0009-0001-3359-3346'
identifiers:
- type: doi
value: 10.5281/zenodo.7834197
repository-code: 'https://github.com/stefmolin/data-morph'
url: 'https://stefmolin.github.io/data-morph/'
abstract: >-
Morph an input dataset of 2D points into select shapes,
while preserving the summary statistics to a given number
of decimal points through simulated annealing.
keywords:
- data visualization
- summary statistics
- data animation
license: MIT
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
[![codecov](https://codecov.io/gh/stefmolin/data-morph/branch/main/graph/badge.svg?token=3SEEG9SZQO)](https://codecov.io/gh/stefmolin/data-morph)
[![CI](https://github.com/stefmolin/data-morph/actions/workflows/ci.yml/badge.svg)](https://github.com/stefmolin/data-morph/actions/workflows/ci.yml)
[![Deploy Docs](https://github.com/stefmolin/data-morph/actions/workflows/docs.yml/badge.svg)](https://github.com/stefmolin/data-morph/actions/workflows/docs.yml)
[![DOI](https://zenodo.org/badge/597895841.svg)](https://zenodo.org/badge/latestdoi/597895841)


Morph an input dataset of 2D points into select shapes, while preserving the summary
statistics to a given number of decimal points through simulated annealing.
Morph an input dataset of 2D points into select shapes, while preserving the summary statistics to a given number of decimal points through simulated annealing.

![Morphing the panda dataset into the star shape.](https://raw.githubusercontent.com/stefmolin/data-morph/main/docs/_static/panda-to-star-eased.gif)

Expand All @@ -22,9 +22,7 @@ $ pip install data-morph-ai

## Usage

Once installed, Data Morph can be used on the command line or as an importable Python package.
Below are some examples; be sure to check out the
[documentation](https://stefmolin.github.io/data-morph) for more information.
Once installed, Data Morph can be used on the command line or as an importable Python package. Below are some examples; be sure to check out the [documentation](https://stefmolin.github.io/data-morph) for more information.


### Command Line Usage
Expand All @@ -35,8 +33,7 @@ Run `data-morph` on the command line:
$ data-morph --start-shape panda --target-shape star
```

This produces the animation in the newly-created `morphed_data` directory
within your current working directory (shown above).
This produces the animation in the newly-created `morphed_data` directory within your current working directory (shown above).

----

Expand All @@ -48,9 +45,7 @@ $ data-morph --help

### Python Usage

The `DataMorpher` class performs the morphing from a `Dataset` to a `Shape`.
Any `pandas.DataFrame` with numeric columns `x` and `y` can be a `Dataset`.
Use the `DataLoader` to create the `Dataset` from a file or use a built-in dataset:
The `DataMorpher` class performs the morphing from a `Dataset` to a `Shape`. Any `pandas.DataFrame` with numeric columns `x` and `y` can be a `Dataset`. Use the `DataLoader` to create the `Dataset` from a file or use a built-in dataset:

```python
from data_morph.data.loader import DataLoader
Expand Down Expand Up @@ -98,4 +93,8 @@ In this example, we morphed the built-in panda `Dataset` into the star `Shape`.
This code has been altered by Stefanie Molin ([@stefmolin](https://github.com/stefmolin)) to work for other input datasets by parameterizing the target shapes with information from the input shape. The original code works for a specific dataset called the "Datasaurus" and was created for the paper *Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing* by Justin Matejka and George Fitzmaurice (ACM CHI 2017).

The paper, video, and associated code and datasets can be found on the
Autodesk Research website [here](https://www.autodeskresearch.com/publications/samestats>). The version of this code placed on GitHub at [jmatejka/same-stats-different-graphs](https://github.com/jmatejka/same-stats-different-graphs), served as the starting point for the Data Morph code base, which is on GitHub at [stefmolin/data-morph](https://github.com/stefmolin/data-morph).
Autodesk Research website [here](https://www.autodeskresearch.com/publications/samestats). The version of this code placed on GitHub at [jmatejka/same-stats-different-graphs](https://github.com/jmatejka/same-stats-different-graphs), served as the starting point for the Data Morph code base, which is on GitHub at [stefmolin/data-morph](https://github.com/stefmolin/data-morph).

## Citations

If you use this software, please cite both Data Morph (DOI: [10.5281/zenodo.7834197](https://doi.org/10.5281/zenodo.7834197)) and *[Same Stats, Different Graphs: Generating Datasets with Varied Appearance and Identical Statistics through Simulated Annealing](https://www.autodeskresearch.com/publications/samestats)* by Justin Matejka and George Fitzmaurice (ACM CHI 2017).
4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ This produces the following animation in the directory specified as ``output_dir

.. note::
There is also a :ref:`CLI option <quickstart:command line usage>` for morphing.

.. rubric:: Citations

.. include:: citation.rst
6 changes: 6 additions & 0 deletions docs/citation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
If you use this software, please cite both Data Morph (DOI:
`10.5281/zenodo.7834197 <https://doi.org/10.5281/zenodo.7834197>`_) and
"`Same Stats, Different Graphs: Generating Datasets with Varied Appearance
and Identical Statistics through Simulated Annealing
<https://www.autodeskresearch.com/publications/samestats>`_"
by Justin Matejka and George Fitzmaurice (ACM CHI 2017).
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ Data Morph

.. include:: quickstart.rst
:start-after: .. INSTALLATION

Citations
---------

.. include:: citation.rst