Tags: maxitg/SetReplace
Tags
Fix labels for list-types in $SetReplaceTypeGraph (#625) ## Changes * Labels for types that are lists (e.g., `{MultisetSubstitutionSystem, 0}`) don't currently show correctly due to `Graph` interpreting `MultisetSubstitutionSystem` and `0` as separate labels and plotting them on top of each other. * This PR fixes that by converting labels to strings. ## Examples * Declare a type: ```wl SetReplace`PackageScope`declareTypeTranslation[Identity, {String, 0}, {Integer, 0}]; Unprotect[$SetReplaceTypes]; Unprotect[$SetReplaceProperties]; Unprotect[$SetReplaceTypeGraph]; SetReplace`PackageScope`initializeTypeSystem[]; ``` * Show a type graph which is now rendered correctly: ```wl In[] := $SetReplaceTypeGraph ``` <img width="478" alt="image" src="https://user-images.githubusercontent.com/1479325/111526067-47551080-872c-11eb-86db-235d9d17f16d.png">
Acyclic graph take (#601) ## Changes * Created the function AcyclicGraphTake which accepts a directed, acyclic graph and a list of two vertices, returning the intersection of the in-component of the first vertex (i.e. start vertex) with the out-component of the second vertex (i.e. end vertex). * Function definition, tests, and documentation are all provided. ## Error checking * The function checks for invalid inputs of the form of the graph not being directed and acyclic, the vertices not being part of the graph, incorrect argument count, among others. ## Examples <img width="696" alt="2021-01-22" src="https://user-images.githubusercontent.com/70669841/105517964-10bfc400-5cae-11eb-8a39-49d12c3e3d56.png"> <img width="215" alt="2021-01-22 (1)" src="https://user-images.githubusercontent.com/70669841/105518136-49f83400-5cae-11eb-80b0-21102bec01ca.png">
Markdown Linter (#581) ## Changes * Adds [markdown linter](https://github.com/DavidAnson/markdownlint) * Enforces 120 characters line width * Related to #247 * Closes #582 ## Examples Some common errors: ![image](https://user-images.githubusercontent.com/26678747/102560353-08b5a880-40a0-11eb-87be-be2787ccdc6c.png) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/581) <!-- Reviewable:end -->
RandomHypergraph (#511) ## Changes * Close #510. * Implements `RandomHypergraph` function. ## Comments * Missing option `"Connected" -> True` to specifically generate random connected hypergraphs. ## Examples ```wl In[] := SeedRandom[2]; RandomHypergraph[8] Out[] = {{2, 3}, {8}, {1, 6}, {7, 7}, {1}} In[] := RandomHypergraph[8, 10] Out[] = {{3, 7, 7}, {1, 7}, {10, 2, 6}} In[] := RandomHypergraph[{5, 2}] Out[] = {{5, 1}, {10, 7}, {9, 3}, {3, 2}, {4, 6}} In[] := RandomHypergraph[{{5, 2}, {4, 3}}, 2] Out[] = {{1, 1}, {1, 1}, {2, 2}, {1, 1}, {1, 2}, {1, 2, 2}, {1, 1, 2}, {1, 2, 2}, {2, 1, 1}} ``` ```wl In[]:= SeedRandom[111]; Grid[Partition[ Table[Labeled[WolframModelPlot@#, # -> i] &[ RandomHypergraph[i]], {i, 1, 12}], 3, 3, 1], Frame -> All] ``` ![image](https://user-images.githubusercontent.com/40190339/98330685-e886ca00-1fc8-11eb-92ab-1aca157be21c.png) ## Documentation ![image](https://user-images.githubusercontent.com/40190339/98401650-05a4b280-2034-11eb-9ae3-fd2b14f17c46.png) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/511) <!-- Reviewable:end -->
Replace all Module's with ModuleScope (#461) ## Changes * Closes #460. * Replaces (almost) all `Module`'s with `ModuleScope`'s. * Adds ```PackageImport["GeneralUtilities`"]``` where `ModuleScope` was used. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/461) <!-- Reviewable:end -->
Improve performance of encodeNestedLists (#453) ## Changes * Closes #46. * Improve performance of `encodeNestedLists` inside `setSubstitutionSystem$cpp.m` by not using `ReplaceRepeated`. ## Examples ```wl In[]:= rules = {{{a_, b_}, {a_, c_}, {a_, d_}} :> Module[{$0, $1, $2}, {{$0, $1}, {$1, $2}, {$2, $0}, {$0, $2}, \ {$2, $1}, {$1, $0}, {$0, b}, {$1, c}, {$2, d}, {b, $2}, {d, $0}}]}; AbsoluteTiming[set = SetReplace[{{0, 0}, {0, 0}, {0, 0}}, rules, 100]] // First AbsoluteTiming[SetReplace[set, rules]][[1]] Out[]= 0.052426 Out[]= 0.026598 ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/453) <!-- Reviewable:end -->
Fix WolframModelPlot for Wolfram Language 12.2 (#433) ## Changes * `ConvexHullMesh` is broken in Wolfram Language 12.2. It seems that only 1D examples evaluate, 2D and 3D example return unevaluated even if using examples from the documentation. * Because of this, `WolframModelPlot` is currently broken. * This PR changes `WolframModelPlot` to use the new `convexHullPolygon` (#432) instead of `ConvexHullMesh`. ## Comments * The tests will fail until #432 is merged. * I will also update the CI soon to version 12.2 so that the tests on the current master will start failing as well. * Visually verified `WolframModelPlot` and `RulePlot` on all examples from documentation. ## Examples * `WolframModelPlot` now works as expected: ```wl In[] := $Version Out[] = "12.2.0 for Mac OS X x86 (64-bit) (October 3, 2020)" ``` ```wl In[] := WolframModelPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7}}] ``` ![image](https://user-images.githubusercontent.com/1479325/95257565-1e7a3800-07ea-11eb-8325-0f7e269444d2.png) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/433) <!-- Reviewable:end -->
Local Multiway System research page (#405) ## Changes * Closes #334. * Adds a research page explaining how the local multiway system works, and showing some examples for both match-all and spacelike multiway systems. ## Comments * This is a "living" document, and it will be improved in future PRs. Anybody can contribute, even if they are not the original author. For example, it will be updated once the progress is done on local isomorphism (see future research section). * The purpose of this pull request is essentially a peer-review of this bulletin. Feel free to leave comments for both the physics content, the system description, as well as small/technical comments about the explanation. * If you are not a *SetReplace* collaborator, you can still comment below. ## Examples * Read the [rendered version](https://github.com/maxitg/SetReplace/blob/localMultiwaySystemNote/Research/LocalMultiwaySystem/LocalMultiwaySystem.md). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/maxitg/setreplace/405) <!-- Reviewable:end -->
PreviousNext