diff --git a/README.md b/README.md index 8d09c14..f38fd32 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# aind-library-template +# aind-data-upload [![License](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) ![Code Style](https://img.shields.io/badge/code%20style-black-black) diff --git a/doc_template/source/conf.py b/doc_template/source/conf.py index 68ed126..e39e111 100644 --- a/doc_template/source/conf.py +++ b/doc_template/source/conf.py @@ -7,7 +7,7 @@ from os.path import dirname, abspath from pathlib import Path from datetime import date -from aind_library_template import __version__ as package_version +from aind_data_upload import __version__ as package_version INSTITUTE_NAME = "Allen Institute for Neural Dynamics" diff --git a/pyproject.toml b/pyproject.toml index f1b6607..af07bef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,8 +3,8 @@ requires = ["setuptools", "setuptools-scm"] build-backend = "setuptools.build_meta" [project] -name = "aind-library-template" -description = "Prints messages to stdout. Simple boilerplate for libraries." +name = "aind-data-upload" +description = "Generated from aind-library-template" license = {text = "MIT"} requires-python = ">=3.7" authors = [ @@ -17,7 +17,6 @@ readme = "README.md" dynamic = ["version"] dependencies = [ - 'pandas' ] [project.optional-dependencies] @@ -35,7 +34,7 @@ dev = [ where = ["src"] [tool.setuptools.dynamic] -version = {attr = "aind_library_template.__version__"} +version = {attr = "aind_data_upload.__version__"} [tool.black] line-length = 79 @@ -60,7 +59,7 @@ exclude = ''' [tool.coverage.run] omit = ["*__init__*"] -source = ["aind_library_template", "tests"] +source = ["aind_data_upload", "tests"] [tool.coverage.report] exclude_lines = [ diff --git a/src/aind_data_upload/__init__.py b/src/aind_data_upload/__init__.py new file mode 100644 index 0000000..d0a8547 --- /dev/null +++ b/src/aind_data_upload/__init__.py @@ -0,0 +1,2 @@ +"""Init package""" +__version__ = "0.0.0" diff --git a/src/aind_library_template/__init__.py b/src/aind_library_template/__init__.py deleted file mode 100644 index 63c732e..0000000 --- a/src/aind_library_template/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Simple package to demo project structure. -""" -__version__ = "0.3.3" diff --git a/src/aind_library_template/message_handlers.py b/src/aind_library_template/message_handlers.py deleted file mode 100644 index cd13cf3..0000000 --- a/src/aind_library_template/message_handlers.py +++ /dev/null @@ -1,34 +0,0 @@ -""" Module to handle printing messages to stdout. -""" - -import logging - -import pandas as pd - - -class MessageHandler: - """ - Class to handle messages. - """ - - def __init__(self, msg): - """ - Args: - msg (str): Message to handle. - """ - self.msg = msg - - def log_msg(self): - """Simply logs the message.""" - logging.info(self.msg) - - def msg_as_df(self, col_name="message"): - """Returns message as a dataframe. - Args: - col_name (str, optional): Column name for message. - Defaults to None. - - Returns: - pandas DataFrame - """ - return pd.DataFrame.from_dict({col_name: [self.msg]}) diff --git a/tests/test_message_handler.py b/tests/test_message_handler.py deleted file mode 100644 index 75cd784..0000000 --- a/tests/test_message_handler.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Tests aind_library_template printers methods.""" - -import unittest - -import pandas as pd - -from aind_library_template import message_handlers - - -class MessageHandlerTest(unittest.TestCase): - """Tests MessageHandler methods.""" - - my_msg = "Hello World!!" - p = message_handlers.MessageHandler(my_msg) - - def test_log_msg(self): - """Tests that the log_msg method logs a message.""" - with self.assertLogs() as captured: - self.p.log_msg() - - self.assertEqual(len(captured.records), 1) - self.assertEqual(captured.records[0].getMessage(), self.my_msg) - - def test_msg_as_df(self): - """Tests that the message gets returned as a pandas DataFrame.""" - - # df from msg with default col_name - df1 = self.p.msg_as_df() - # df from msg with non-default col_name - df2 = self.p.msg_as_df(col_name="non_default") - - # Expected outputs - expected_df1 = pd.DataFrame.from_dict({"message": [self.my_msg]}) - expected_df2 = pd.DataFrame.from_dict({"non_default": [self.my_msg]}) - - self.assertTrue(df1.equals(expected_df1)) - self.assertTrue(df2.equals(expected_df2)) - self.assertTrue(not df1.equals(expected_df2)) - - -if __name__ == "__main__": - unittest.main()