Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
0.4.0 dep BitemporalPostgres 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfliegner committed Sep 26, 2022
1 parent 03701ea commit 3f728dc
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.8.0"
manifest_format = "2.0"
project_hash = "dd4375ead039dbffa6197d5da8dc8b89f8be87cb"
project_hash = "f43d39537a5b3ffc3f960dcdf9e44421212139fb"

[[deps.AbstractTrees]]
git-tree-sha1 = "5c0b629df8a5566a06f5fef5100b53ea56e465a0"
Expand All @@ -27,9 +27,7 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[deps.BitemporalPostgres]]
deps = ["AbstractTrees", "Dates", "Intervals", "Logging", "Pkg", "SearchLight", "SearchLightPostgreSQL", "Test", "TimeZones", "ToStruct", "YAML"]
git-tree-sha1 = "9e6e7e2319f86507d44075690d720ca041f0d570"
repo-rev = "main"
repo-url = "https://github.com/Actuarial-Sciences-for-Africa-ASA/BitemporalPostgres.jl"
git-tree-sha1 = "180f11e9a9e5fc2a3efb4067b0e684e587607957"
uuid = "e513cd14-23e6-48df-acf1-d9bc8fa5674b"
version = "1.4.1"

Expand All @@ -40,9 +38,9 @@ version = "0.4.2"

[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "dc4405cee4b2fe9e1108caec2d760b7ea758eca2"
git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.15.5"
version = "1.15.6"

[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
Expand Down Expand Up @@ -97,15 +95,15 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"

[[deps.DataAPI]]
git-tree-sha1 = "fb5f5316dd3fd4c5e7c30a24d50643b73e37cd40"
git-tree-sha1 = "1106fa7e1256b402a86a8e7b15c00c85036fef49"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.10.0"
version = "1.11.0"

[[deps.DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "6bce52b2060598d8caaed807ec6d6da2a1de949e"
git-tree-sha1 = "db2a9cb664fcea7836da4b414c3278d71dd602d2"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.3.5"
version = "1.3.6"

[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
Expand Down Expand Up @@ -535,9 +533,9 @@ version = "1.0.1"

[[deps.Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
git-tree-sha1 = "5ce79ce186cc678bbb5c5681ca3379d1ddae11a1"
git-tree-sha1 = "2d7164f7b8a066bcfa6224e67736ce0eb54aef5b"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.7.0"
version = "1.9.0"

[[deps.Tar]]
deps = ["ArgTools", "SHA"]
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
ToStruct = "43ec2cc1-0e50-5406-a854-b7ff8fdb8dad"

[compat]
BitemporalPostgres = "1.4.1"
ColorSchemes = "3"
DataFrames = "1"
Intervals = "1.6.0"
Expand Down
123 changes: 123 additions & 0 deletions testModelCompare.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Dict{String, Any} with 8 entries:\n",
" \"tsdb_validfrom\" => \"2022-09-26T11:30:44.483+00:00\"\n",
" \"ref_history\" => Dict{String, Any}(\"value\"=>9)\n",
" \"revision\" => Dict{String, Any}(\"ref_validfrom\"=>Dict{String, Any}(\"val…\n",
" \"partner_refs\" => Any[Dict{String, Any}(\"rev\"=>Dict{String, Any}(\"ref_valid…\n",
" \"ref_entities\" => Dict{String, Any}()\n",
" \"ref_version\" => Dict{String, Any}(\"value\"=>12)\n",
" \"tsw_validfrom\" => \"2022-09-26T11:30:44.483+00:00\"\n",
" \"product_items\" => Any[Dict{String, Any}(\"tariff_items\"=>Any[Dict{String, An…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"push!(LOAD_PATH, \"src\")\n",
"using JSON, LifeInsuranceDataModel, SearchLight, TimeZones, ToStruct\n",
"ENV[\"SEARCHLIGHT_USERNAME\"] = \"bitemporalpostgres\"\n",
"ENV[\"SEARCHLIGHT_PASSWORD\"] = \"jw8s0F49KL\"\n",
"\n",
"model0 = JSON.parse(JSON.json(csection(1, now(tz\"UTC\"), now(tz\"UTC\"))))\n",
"model1 = JSON.parse(JSON.json(csection(1, now(tz\"UTC\"), now(tz\"UTC\"))))\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"KeySet for a Dict{String, Any} with 5 entries. Keys:\n",
" \"ref_validfrom\"\n",
" \"ref_invalidfrom\"\n",
" \"ref_component\"\n",
" \"id\"\n",
" \"description\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"model0[\"revision\"]\n",
"keys(model0[\"revision\"])\n",
"\n",
"model1[\"revision\"][\"id\"][\"value\"] = nothing\n",
"model1[\"revision\"][\"description\"]= \"first mutation by GUI model\"\n",
"\n",
"model1[\"revision\"]\n",
"ToStruct.tostruct(ContractRevision, model1[\"revision\"])\n"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"\" diff for ref_component eq for id eq for description\""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"function compareModelState(previous::Dict{String,Any}, current::Dict{String,Any})\n",
" println(\"huhu\")\n",
"end\n",
"\n",
"function compareRevisions(previous::Dict{String,Any}, current::Dict{String,Any})\n",
" diff = \"\"\n",
" for (key, previous_value) in previous\n",
" if !(key in (\"ref_validfrom\", \"ref_invalidfrom\"))\n",
" let current_value = current[key]\n",
" if previous_value != current_value\n",
" diff = diff * \" diff for \" * key\n",
" else\n",
" diff = diff * \" eq for \" * key\n",
" end\n",
" end\n",
" end\n",
" end\n",
" diff\n",
"end\n",
"compareRevisions(model0[\"revision\"], model1[\"revision\"])"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.8.0",
"language": "julia",
"name": "julia-1.8"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.8.0"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

2 comments on commit 3f728dc

@michaelfliegner
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release Notes:
dep BitemporalPostgres 1.4.1

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/68989

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 3f728dcaff484385acc748766e1bbd1373e67696
git push origin v0.4.0

Please sign in to comment.