Skip to content
Snippets Groups Projects
Commit 733b232c authored by nugget's avatar nugget
Browse files

Add module docstrings.

parent a93bf070
No related branches found
No related tags found
3 merge requests!12v.0.1 for alpha release,!7Bring packaging branch up to date,!6Implement basic functionality of publish.
Pipeline #717754 passed with warnings
"""Handling of hdf5 data files."""
import h5py
# Shows how to create an externalLink (symbolic) to a hdf5 File
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tag your plot with an ID.
For publishing the tagged plot along your research data have a look at the
module publish.
Functions:
TagPlot(figure object, string) -> list
"""
import warnings
from TagPlot_matplotlib import TagPlot_matplotlib
......@@ -16,10 +25,10 @@ def TagPlot(figs, engine, prefix='', method=1, location='east'):
----------
figs : list
Figures that should be tagged.
prefix : string
Will be added as prefix to the ID.
engine : string
Plot engine which should be used to tag the plot.
prefix : string
Will be added as prefix to the ID.
method : int, optional
Method for creating the ID. Create an ID by Unix time is referenced
as 1, create a random ID with method=2. The default is 1.
......@@ -61,7 +70,6 @@ def TagPlot(figs, engine, prefix='', method=1, location='east'):
else:
raise TypeError("Location is not a string.")
# TODO: Implement backwards combatibility with if-clauses
match location:
case 'north':
rotation = 0
......
# -*- coding: utf-8 -*-
"""
Tag your matplotlib plot with an ID.
Functions:
TagPlot_matplotlib(figure object, string) -> list
"""
# from fcn_help.FST_colors import Colors
import matplotlib
import matplotlib.pyplot as plt
import create_id
# plt.style.use('./fcn_help/FST.mplstyle')
def TagPlot_matplotlib(figs, prefix, method, rotation, position):
......
# -*- coding: utf-8 -*-
"""
Create an identifier to print it on a plot.
Functions:
create_id(int) -> string
"""
import time
import uuid
......
# -*- coding: utf-8 -*-
"""
Example workflow for integrating plotIDs.
Example workflow for integrating plotID.
With tagplot an ID can be generated an printed on the plot. To export the plot
along with the corresponding research data and the plot generating script use
the function publish.
"""
# %% Import modules
......
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 12 13:09:35 2021.
@author: Richter
"""
"""Compare if data already exists in published folder to avoid redundancy."""
# Test des Moduls filecmp — File and Directory Comparisons
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Publish a tagged plot along the corresponding research data.
Export the tagged figure to a directory that also contains the raw data where
the plot is based on. Additionally, the script that produced the plot will be
copied to the destination directory.
Functions:
publish(path-like, path-like, figure, string, string) -> None
"""
import os
import shutil
......
# -*- coding: utf-8 -*-
"""
Runner for all tests regarding the plotid project.
Includes starting all tests and measuring the code coverage.
"""
import unittest
import coverage
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Export a plot figure to a picture file.
Functions:
save_plot(figure, string) -> path-like
"""
import matplotlib
import matplotlib.pyplot as plt
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
"""
Unittests for TagPlot_matplotlib
'''
"""
import unittest
from TagPlot_matplotlib import TagPlot_matplotlib
import numpy as np
......@@ -22,13 +23,11 @@ color2 = 'yellow'
fig1 = plt.figure()
plt.plot(x, y, color=color1)
plt.plot(x, y_2, color=color2)
plt.clf # Close figure
# 2.Figure
fig2 = plt.figure()
plt.plot(x, y, color=color2)
plt.plot(x, y_2, color=color1)
plt.clf # Close figure
fig = [fig1, fig2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment