Skip to content

Commit

Permalink
Merge pull request #21 from pjoiner/v0.1.9-Pre
Browse files Browse the repository at this point in the history
V0.1.9 pre
  • Loading branch information
pjoiner committed Dec 3, 2021
2 parents 3d8e128 + c1921b8 commit dd4b441
Show file tree
Hide file tree
Showing 15 changed files with 536 additions and 125 deletions.
3 changes: 2 additions & 1 deletion NuGet.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
Expand All @@ -11,6 +11,7 @@
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="MachineLearning" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<disabledPackageSources />
</configuration>
2 changes: 1 addition & 1 deletion notebooks/01_Introduction.ipynb
Expand Up @@ -38,7 +38,7 @@
"outputs": [],
"source": [
"#r \"nuget:DwC-A_dotnet,0.6.0\"\n",
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.8-Pre\""
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.9-Pre\""
]
},
{
Expand Down
40 changes: 20 additions & 20 deletions notebooks/02_Formatting.ipynb
Expand Up @@ -19,11 +19,11 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"#r \"nuget:DwC-A_dotnet,0.6.0\"\n",
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.8-Pre\""
],
"outputs": []
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.9-Pre\""
]
},
{
"cell_type": "markdown",
Expand All @@ -44,6 +44,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using DwC_A;\n",
"using System.IO.Compression;\n",
Expand All @@ -55,8 +56,7 @@
"ZipFile.ExtractToDirectory(\"./data/Papilionidae.zip\", outputPath);\n",
"var archive = new ArchiveReader(outputPath);\n",
"archive.MetaData"
],
"outputs": []
]
},
{
"cell_type": "code",
Expand All @@ -66,13 +66,13 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"var occurrence = archive.CoreFile;\n",
"var multimedia = archive.Extensions.GetFileReaderByFileName(\"multimedia.txt\");\n",
"display(occurrence);\n",
"display(multimedia);"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -93,6 +93,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using Microsoft.DotNet.Interactive.Formatting;\n",
"\n",
Expand All @@ -104,8 +105,7 @@
" var output = div[style: \"font-style: italic\"]($\"{scientificName.genus} {scientificName.species}\");\n",
" writer.Write(output);\n",
"}, \"text/html\" );"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -124,6 +124,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using DwC_A.Terms;\n",
"\n",
Expand All @@ -132,8 +133,7 @@
" date = n[Terms.eventDate],\n",
" scientificName = new ScientificName(n[Terms.genus], n[Terms.specificEpithet])\n",
" })"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -152,6 +152,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"public record Link(string url);\n",
"\n",
Expand All @@ -166,8 +167,7 @@
" scientificName = new ScientificName(n[Terms.genus], n[Terms.specificEpithet]),\n",
" link = new Link(n[Terms.references])\n",
" })"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -188,6 +188,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"public record ImageUrl(string url, string caption = \"\");\n",
"\n",
Expand All @@ -198,8 +199,7 @@
" );\n",
" writer.Write(fig);\n",
"}, \"text/html\");"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -216,6 +216,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using DwC_A.Terms;\n",
"\n",
Expand All @@ -231,8 +232,7 @@
"}; \n",
"\n",
"media"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -251,6 +251,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"Formatter.Register<IEnumerable<ImageUrl>>((images, writer) =>{\n",
" var figs = new List<dynamic>();\n",
Expand All @@ -261,8 +262,7 @@
"}, \"text/html\");\n",
"\n",
"media.Select(n => n.image)"
],
"outputs": []
]
}
],
"metadata": {
Expand All @@ -281,4 +281,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
28 changes: 14 additions & 14 deletions notebooks/03_DataFrame.ipynb
Expand Up @@ -19,14 +19,14 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"#r \"nuget: XPlot.Plotly, 4.0.6\"\n",
"#r \"nuget: XPlot.Plotly.Interactive, 4.0.6\"\n",
"#r \"nuget: Microsoft.Data.Analysis, 0.19.0\"\n",
"#r \"nuget: DwC-A_dotnet, 0.6.0\"\n",
"#r \"nuget: DwC-a_dotnet.Interactive, 0.1.8-Pre\""
],
"outputs": []
"#r \"nuget: DwC-a_dotnet.Interactive, 0.1.9-Pre\""
]
},
{
"cell_type": "markdown",
Expand All @@ -45,6 +45,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using Microsoft.AspNetCore.Html;\n",
"using Microsoft.DotNet.Interactive.Formatting;\n",
Expand Down Expand Up @@ -79,8 +80,7 @@
"\n",
" writer.Write(t);\n",
"}, \"text/html\");"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -99,6 +99,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using DwC_A;\n",
"using DwC_A.Terms;\n",
Expand All @@ -121,8 +122,7 @@
"\n",
"var eventID = eventFile.DataRows.Skip(2).Select(row => row[Terms.eventID]).First();\n",
"display(eventID);"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -141,6 +141,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using Microsoft.Data.Analysis;\n",
"\n",
Expand All @@ -158,8 +159,7 @@
"\n",
"var df = new DataFrame(species, counts);\n",
"df.Info()"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -180,12 +180,12 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"var sum = (int)counts.Sum();\n",
"double D = 1 - (double)(int)(counts.Apply(n => n * (n - 1)).Sum()) / (sum * (sum - 1));\n",
"display($\"D = {D:0.00}\")"
],
"outputs": []
]
},
{
"cell_type": "markdown",
Expand All @@ -204,6 +204,7 @@
"language": "csharp"
}
},
"outputs": [],
"source": [
"using XPlot.Plotly;\n",
"\n",
Expand All @@ -213,8 +214,7 @@
"var chart = Chart.Column(kvp);\n",
"chart.WithTitle($\"Event: {eventID}\");\n",
"display(chart)"
],
"outputs": []
]
}
],
"metadata": {
Expand All @@ -233,4 +233,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
16 changes: 8 additions & 8 deletions notebooks/04_FSharp.ipynb
Expand Up @@ -21,14 +21,14 @@
"language": "fsharp"
}
},
"outputs": [],
"source": [
"#r \"nuget:Plotly.NET,2.0.0-preview.15\"\n",
"#r \"nuget:Plotly.NET.Interactive,2.0.0-preview.15\"\n",
"#r \"nuget:FSharp.Data,4.2.5\"\n",
"#r \"nuget:DwC-A_dotnet,0.6.0\"\n",
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.8-Pre\""
],
"outputs": []
"#r \"nuget:DwC-A_dotnet.Interactive,0.1.9-Pre\""
]
},
{
"cell_type": "code",
Expand All @@ -38,6 +38,7 @@
"language": "fsharp"
}
},
"outputs": [],
"source": [
"open DwC_A\n",
"open DwC_A.Terms\n",
Expand All @@ -55,8 +56,7 @@
"\n",
"let occurrence = archive.CoreFile;\n",
"occurrence"
],
"outputs": []
]
},
{
"cell_type": "code",
Expand All @@ -66,6 +66,7 @@
"language": "fsharp"
}
},
"outputs": [],
"source": [
"open System.Linq\n",
"open Plotly.NET\n",
Expand Down Expand Up @@ -99,8 +100,7 @@
" |> Chart.withTitle(title = \"Papilionidae of Texas\")\n",
"\n",
"map "
],
"outputs": []
]
}
],
"metadata": {
Expand All @@ -119,4 +119,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}

0 comments on commit dd4b441

Please sign in to comment.