From 48b0f626c65382af233e1d123827d36a1bf9cfba Mon Sep 17 00:00:00 2001 From: rlskoeser Date: Fri, 11 Apr 2025 10:13:32 -0400 Subject: [PATCH 1/2] Reorganize examples and update readme / contents #121 --- examples/README.md | 16 ++-- examples/{notebooks => }/edtf-support.ipynb | 24 ++--- examples/{use-cases => }/ismi/README.md | 0 .../ismi/data/ismi-crm-date-samples.ttl | 0 examples/notebooks/README.md | 6 -- .../shakespeare-and-company-project/README.md | 0 .../SCoData_events_v1.2_2022-01.csv | 0 .../shxco_partial_date_durations.ipynb | 90 +++++++++---------- 8 files changed, 68 insertions(+), 68 deletions(-) rename examples/{notebooks => }/edtf-support.ipynb (99%) rename examples/{use-cases => }/ismi/README.md (100%) rename examples/{use-cases => }/ismi/data/ismi-crm-date-samples.ttl (100%) delete mode 100644 examples/notebooks/README.md rename examples/{use-cases => }/shakespeare-and-company-project/README.md (100%) rename examples/{use-cases => }/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv (100%) rename examples/{notebooks => shakespeare-and-company-project}/shxco_partial_date_durations.ipynb (99%) diff --git a/examples/README.md b/examples/README.md index bf2a99c..127d984 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,7 +1,13 @@ # undate examples -Example data and projects with use cases for uncertain date logic and -example code notebooks using undate. - -- [use cases](use-cases) - examples from projects or specific data with use cases for undate -- [notebooks](notebooks) - code notebooks showing how undate can be used on a specific dataset or for a specific problem +This folder contains code notebooks demonstrating how `undate` can be +used on a specific dataset, problem, or format, as well as example +data from projects with use cases for uncertain date logic. + +## Contents + +- [EDTF support](edtf-support.ipynb) - demonstrate and validate supported portions of the Extended Date Time Format (EDTF) specification (jupyter notebook) +- [ISMI](ismi) - Sample data from the Islamic Scientific Manuscript Initiative project +- [Shakespeare and Company Project](shakespeare-and-company-project) + - Events data from version 1.2 of Shakespeare and Company Project datasets + - [Partial date duration logic](shxco_partial_date_durations.ipynb) - compare `undate` partial date range duration logic with a previous implementation in the _Shakespeare and Company Project_ (jupyter notebook) diff --git a/examples/notebooks/edtf-support.ipynb b/examples/edtf-support.ipynb similarity index 99% rename from examples/notebooks/edtf-support.ipynb rename to examples/edtf-support.ipynb index 0295647..a604838 100644 --- a/examples/notebooks/edtf-support.ipynb +++ b/examples/edtf-support.ipynb @@ -55,7 +55,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "9c6b7379-b2a7-4ec1-afa5-2cd9832c8a5d", "metadata": {}, "outputs": [], @@ -92,7 +92,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "923476ff-344a-4018-a02e-6e5f80ea76a8", "metadata": {}, "outputs": [], @@ -159,7 +159,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "6ed422de-34a2-4324-b254-f62db00563f7", "metadata": {}, "outputs": [], @@ -212,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "8d98a139-627b-40bd-b1c5-d0028e538a53", "metadata": {}, "outputs": [], @@ -255,7 +255,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "id": "532470db-851e-4f91-9242-cd93d35054cf", "metadata": {}, "outputs": [], @@ -320,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "id": "a5abd0e4-0b26-49b0-bf78-3e1fe6c046d8", "metadata": {}, "outputs": [], @@ -425,7 +425,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "e47f3fff-d35c-4c2e-9568-214763f6511a", "metadata": {}, "outputs": [], @@ -481,7 +481,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "39143c1f-932a-450c-9b2d-ffbe3e1416b0", "metadata": {}, "outputs": [], @@ -535,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "id": "95965f17-0bd5-446f-bc09-9503eaed68e2", "metadata": {}, "outputs": [], @@ -589,7 +589,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "id": "c6c2d1a1-39f1-45eb-ac08-1de4fadbe842", "metadata": {}, "outputs": [], @@ -640,7 +640,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "id": "f24fd31a-176a-40b5-bff4-d72b68f32a18", "metadata": {}, "outputs": [], @@ -688,7 +688,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "id": "5910caab-eada-4715-b863-9bbbb15b9c5c", "metadata": {}, "outputs": [], diff --git a/examples/use-cases/ismi/README.md b/examples/ismi/README.md similarity index 100% rename from examples/use-cases/ismi/README.md rename to examples/ismi/README.md diff --git a/examples/use-cases/ismi/data/ismi-crm-date-samples.ttl b/examples/ismi/data/ismi-crm-date-samples.ttl similarity index 100% rename from examples/use-cases/ismi/data/ismi-crm-date-samples.ttl rename to examples/ismi/data/ismi-crm-date-samples.ttl diff --git a/examples/notebooks/README.md b/examples/notebooks/README.md deleted file mode 100644 index 17c1270..0000000 --- a/examples/notebooks/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# `undate` demo notebooks - -This folder contains code notebooks demonstrating how undate can be used on a specific dataset or for a specific problem. - -- [EDTF support](edtf-support.ipynb) - demonstrate and validate supported portions of the Extended Date Time Format (EDTF) specification -- [Partial date duration logic](shxco_partial_date_durations.ipynb) - compare `undate` partial date range duration logic with a previous implementation in the _Shakespeare and Company Project_ diff --git a/examples/use-cases/shakespeare-and-company-project/README.md b/examples/shakespeare-and-company-project/README.md similarity index 100% rename from examples/use-cases/shakespeare-and-company-project/README.md rename to examples/shakespeare-and-company-project/README.md diff --git a/examples/use-cases/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv b/examples/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv similarity index 100% rename from examples/use-cases/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv rename to examples/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv diff --git a/examples/notebooks/shxco_partial_date_durations.ipynb b/examples/shakespeare-and-company-project/shxco_partial_date_durations.ipynb similarity index 99% rename from examples/notebooks/shxco_partial_date_durations.ipynb rename to examples/shakespeare-and-company-project/shxco_partial_date_durations.ipynb index 486981a..38efa6c 100644 --- a/examples/notebooks/shxco_partial_date_durations.ipynb +++ b/examples/shakespeare-and-company-project/shxco_partial_date_durations.ipynb @@ -21,7 +21,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -29,7 +29,7 @@ "output_type": "stream", "text": [ "\n", - "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.3.1\u001b[0m\n", + "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.0.1\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49m/Users/rkoeser/workarea/env/undate/bin/python3 -m pip install --upgrade pip\u001b[0m\n", "Note: you may need to restart the kernel to use updated packages.\n" ] @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -288,7 +288,7 @@ "[5 rows x 28 columns]" ] }, - "execution_count": 3, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -296,8 +296,8 @@ "source": [ "import pandas as pd\n", "\n", - "# load the 1.2 version of S&co events dataset; we have a copy in our use-cases folder\n", - "events_df = pd.read_csv(\"../use-cases/shakespeare-and-company-project/SCoData_events_v1.2_2022-01.csv\", low_memory=False)\n", + "# load the 1.2 version of S&co events dataset; expected to be in the sam folder as this notebook\n", + "events_df = pd.read_csv(\"./SCoData_events_v1.2_2022-01.csv\", low_memory=False)\n", "events_df.head()" ] }, @@ -316,7 +316,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": { "id": "y_MqgrQW64uI" }, @@ -353,7 +353,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -452,7 +452,7 @@ "260 4 months 122.0 " ] }, - "execution_count": 5, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -478,7 +478,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -505,7 +505,7 @@ "Name: count, Length: 133, dtype: int64" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -517,7 +517,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -540,7 +540,7 @@ "Name: subscription_duration_days, dtype: float64" ] }, - "execution_count": 7, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -558,7 +558,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -607,7 +607,7 @@ "Index: []" ] }, - "execution_count": 8, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -619,7 +619,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -688,7 +688,7 @@ "13686 NaN 31.0 " ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -707,7 +707,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": { "id": "jwvN9-CgLQRx" }, @@ -727,7 +727,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -832,7 +832,7 @@ "260 4 months 122.0 152 days " ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -845,7 +845,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -950,7 +950,7 @@ "260 4 months 122.0 152 days " ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -962,7 +962,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 12, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1161,7 +1161,7 @@ "[9144 rows x 7 columns]" ] }, - "execution_count": 13, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -1174,7 +1174,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 13, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -1200,7 +1200,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 14, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -1220,7 +1220,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1403,7 +1403,7 @@ "313 30.0 " ] }, - "execution_count": 15, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -1416,7 +1416,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -1443,7 +1443,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 16, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -1455,7 +1455,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1686,7 +1686,7 @@ "472 30.0 60 days 30.0 " ] }, - "execution_count": 17, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -1709,7 +1709,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -1957,7 +1957,7 @@ "415 29.0 " ] }, - "execution_count": 18, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" } @@ -1982,7 +1982,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -2068,7 +2068,7 @@ "606 G. E. Pulsford --01-20 --01-28 8.0" ] }, - "execution_count": 19, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -2082,7 +2082,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -2168,7 +2168,7 @@ "29908 Ann Samyn 1961-10-04 1962-03-21 168.0" ] }, - "execution_count": 20, + "execution_count": 19, "metadata": {}, "output_type": "execute_result" } @@ -2179,7 +2179,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -2316,7 +2316,7 @@ "611 Gertrude Stein --01-24 --05-30 126.0 126 days" ] }, - "execution_count": 21, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -2329,7 +2329,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 21, "metadata": { "colab": { "base_uri": "https://localhost:8080/", @@ -2489,7 +2489,7 @@ "611 0.0 " ] }, - "execution_count": 22, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } @@ -2502,7 +2502,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 22, "metadata": { "colab": { "base_uri": "https://localhost:8080/" @@ -2519,7 +2519,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 23, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -2551,7 +2551,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 23, "metadata": { "colab": { "base_uri": "https://localhost:8080/", From 6d369289eefa51b168ce55b436c96c9d3e248113 Mon Sep 17 00:00:00 2001 From: rlskoeser Date: Fri, 11 Apr 2025 10:21:49 -0400 Subject: [PATCH 2/2] Fix shxco notebook path and augment description --- examples/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index 127d984..080a6ce 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,6 +8,6 @@ data from projects with use cases for uncertain date logic. - [EDTF support](edtf-support.ipynb) - demonstrate and validate supported portions of the Extended Date Time Format (EDTF) specification (jupyter notebook) - [ISMI](ismi) - Sample data from the Islamic Scientific Manuscript Initiative project -- [Shakespeare and Company Project](shakespeare-and-company-project) - - Events data from version 1.2 of Shakespeare and Company Project datasets - - [Partial date duration logic](shxco_partial_date_durations.ipynb) - compare `undate` partial date range duration logic with a previous implementation in the _Shakespeare and Company Project_ (jupyter notebook) +- [Shakespeare and Company Project](shakespeare-and-company-project) - data, description of partial date implementation, and example notebook + - Events data from version 1.2 of Shakespeare and Company Project datasets + - [Partial date duration logic](shakespeare-and-company-project/shxco_partial_date_durations.ipynb) - compare `undate` partial date range duration logic with a previous implementation in the _Shakespeare and Company Project_ (jupyter notebook)