Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
34
4.22k
embeddings
sequencelengths
768
768
::: tip Make sure you read the [introduction to .NET](/dev/dotnet) before you dive in here! The most important sections you need to cover first are:
[ -1.1221576929092407, -0.6545504927635193, 0.15942485630512238, 0.03176378831267357, -0.5661558508872986, 0.7094968557357788, 0.5261232256889343, -0.4499831795692444, 0.6587446331977844, 0.13174939155578613, -0.2717227041721344, -0.47384923696517944, -0.3597736358642578, -0.1797011941671371...
As you know, Speckle data is structured according to the conventions of the host application, domain or mental model of the developer. There is no single canonical way in which data is structured!
[ -0.22793535888195038, -0.6210981607437134, 0.4941736161708832, 0.4864256978034973, -0.32819539308547974, 0.07106220722198486, 0.1781042367219925, -0.37410688400268555, 0.7374842762947083, 1.0064589977264404, -0.4860646724700928, -0.8307605981826782, -0.2357042282819748, -0.1814493387937545...
Generally, working with structured data is a bit more difficult, as you need to parse the "graph", or the tree that describes its structure. Nevertheless, this doesn't need to be so! What if we could access all the data inside a given commit and treat it just as any other list? Well, it's actually super easy!
[ 0.08256399631500244, -1.0044231414794922, 0.8609516024589539, -0.2258882224559784, -0.309345543384552, 0.2167278528213501, -0.10323012620210648, -0.700217604637146, 0.2156638354063034, 0.3544641435146332, -0.8277190923690796, -0.7700120806694031, -0.5260905623435974, 0.15611211955547333, ...
The extension method below flattens any `Base` object into its constituent parts: it returns a list of all its sub-`Base`s. **Simply add this to your project somewhere and you're good to go.**
[ -0.6907806396484375, -0.5803492069244385, 0.004570931661874056, -0.42225348949432373, -0.5735138058662415, 0.267191082239151, -0.2719898521900177, 0.08338329941034317, 0.635749876499176, 0.6162620782852173, -0.8380923271179199, -1.035427212715149, -0.5061278343200684, -0.2708434760570526, ...
Once we test this a bit more, we're probably going to add it to our Core SDK - so keep an eye out!
[ -0.9245564937591553, -0.11058289557695389, 0.38631871342658997, 0.40555793046951294, -0.361868292093277, -0.29846394062042236, 0.5041781663894653, -0.6854907870292664, 0.36888742446899414, 0.5789862275123596, -0.9803260564804077, -0.5016168355941772, 0.022251741960644722, -0.20023933053016...
public static class Extensions { // Flattens a base object into all its constituent parts. public static IEnumerable<Base> Flatten(this Base obj) { yield return obj;
[ -0.5808952450752258, -0.2987470328807831, -0.18656927347183228, -0.071446992456913, -0.24395261704921722, 0.1412608027458191, -0.07148611545562744, -0.4670619070529938, 0.1255923956632614, 0.6621361374855042, -0.5735397338867188, -0.20775245130062103, -0.10862017422914505, 0.01608825847506...
var props = obj.GetDynamicMemberNames(); foreach (var prop in props) { var value = obj[prop]; if (value == null) continue;
[ -0.040468424558639526, -0.3197799324989319, 0.4831668734550476, -0.3480510711669922, -0.5688010454177856, 0.7949169278144836, 0.19802866876125336, 0.10607261210680008, 0.49867627024650574, 1.244863748550415, -0.674939751625061, -0.46929723024368286, -0.8861204981803894, -0.3616665899753570...
if (value is Base b) { var nested = b.Flatten(); foreach (var child in nested) yield return child; }
[ 0.17727535963058472, -0.28055357933044434, -0.11314164847135544, 0.14846128225326538, -0.4828800857067108, 0.5866183638572693, -0.2044980376958847, 0.01997951790690422, 0.018609432503581047, 0.6116635203361511, -0.755030632019043, -0.8991771340370178, -0.8585329055786133, -0.51482707262039...
if (value is IDictionary dict) { foreach (var dictValue in dict.Values) { if (dictValue is Base lb) { foreach (var lbChild in lb.Flatten()) yield return lbChild; } } }
[ -0.138417050242424, -0.336856871843338, -0.01237448863685131, 0.07687027752399445, -0.5466201305389404, 0.4760158956050873, -0.2576373219490051, 0.20740824937820435, 0.37685710191726685, 0.5832527279853821, -0.6755736470222473, -0.6748975515365601, -0.6365107297897339, -0.1968294382095337,...
if (value is IEnumerable enumerable) { foreach (var listValue in enumerable) { if (listValue is Base lb) { foreach (var lbChild in lb.Flatten()) yield return lbChild; } } } } } }
[ -0.22612637281417847, -0.05680735036730766, -0.46853339672088623, 0.16994963586330414, -0.07587596774101257, 0.4600212574005127, 0.0474124550819397, -0.09061063826084137, 0.09027764201164246, 0.8706109523773193, -0.46984121203422546, -0.34128597378730774, -0.5864341855049133, -0.1608902961...
Now that we have our flattening method in place, what can we do? Well - quite a lot! We can now use the power of LINQ to do complex queries on our dataset. For example, let's assume we want to get **all the timber walls** from a given building. How should we do that? Easy:
[ -0.6707361340522766, -0.8485864400863647, 0.22171266376972198, -0.08593600243330002, -0.11350177228450775, 0.20285533368587494, -0.07629550248384476, -0.5801784992218018, 0.12803970277309418, 0.9111613035202026, -0.16392268240451813, -0.2911643087863922, -0.316364049911499, -0.330344587564...
// Receive a revit commit (note: you will need a local account on app.speckle.systems for this to work!) var data = Helpers.Receive("https://speckle.xyz/streams/0d3cb7cb52/commits/681cdd572c").Result; var flatData = data.Flatten().ToList();
[ -0.2816719114780426, 0.2651338577270508, 0.08773083239793777, -0.22735433280467987, -0.29194188117980957, 0.4264794588088989, 0.02485756203532219, -0.1682528555393219, 0.9969061017036438, 1.009806752204895, -0.6720264554023743, -0.5240105986595154, -0.5359538793563843, -0.20561176538467407...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5