From 4273d58a187d715597c885798aaa7b110ac8b109 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Sep 2024 03:39:34 +0000 Subject: [PATCH] ci: version bump [skip actions] --- README.md | 2 +- doc_template/source/conf.py | 2 +- pyproject.toml | 9 ++-- src/aind_library_template/__init__.py | 3 -- src/aind_library_template/message_handlers.py | 34 --------------- src/pinpoint_api/__init__.py | 2 + tests/test_message_handler.py | 42 ------------------- 7 files changed, 8 insertions(+), 86 deletions(-) delete mode 100644 src/aind_library_template/__init__.py delete mode 100644 src/aind_library_template/message_handlers.py create mode 100644 src/pinpoint_api/__init__.py delete mode 100644 tests/test_message_handler.py diff --git a/README.md b/README.md index c5bfe53..ee01218 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# aind-library-template +# pinpoint-api [![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..2119d64 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 pinpoint_api import __version__ as package_version INSTITUTE_NAME = "Allen Institute for Neural Dynamics" diff --git a/pyproject.toml b/pyproject.toml index f1b6607..90aaf79 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 = "pinpoint-api" +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 = "pinpoint_api.__version__"} [tool.black] line-length = 79 @@ -60,7 +59,7 @@ exclude = ''' [tool.coverage.run] omit = ["*__init__*"] -source = ["aind_library_template", "tests"] +source = ["pinpoint_api", "tests"] [tool.coverage.report] exclude_lines = [ diff --git a/src/aind_library_template/__init__.py b/src/aind_library_template/__init__.py deleted file mode 100644 index 6df6820..0000000 --- a/src/aind_library_template/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Simple package to demo project structure. -""" -__version__ = "0.3.4" 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/src/pinpoint_api/__init__.py b/src/pinpoint_api/__init__.py new file mode 100644 index 0000000..d0a8547 --- /dev/null +++ b/src/pinpoint_api/__init__.py @@ -0,0 +1,2 @@ +"""Init package""" +__version__ = "0.0.0" 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()