Skip to content

Commit

Permalink
Update and init.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeough committed Nov 28, 2023
1 parent f15ebe8 commit 0d2e342
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 49 deletions.
4 changes: 4 additions & 0 deletions Grids/SketchGrids/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ Generate grids automatically from conceptual masses or sketch grid lines.
|Output Name|Type|Description|
|---|---|---|


<br>

## Additional Information
5 changes: 3 additions & 2 deletions Grids/SketchGrids/dependencies/ConceptualMass.g.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v12.0.0.0) (http://NJsonSchema.org)
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
Expand All @@ -23,7 +23,7 @@ namespace Elements

/// <summary>Represents an early stage building massing volume. Its boundary typically represents the nominal edge of slab, and may be articulated further by subsequent functions.</summary>
[JsonConverter(typeof(Elements.Serialization.JSON.JsonInheritanceConverter), "discriminator")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class ConceptualMass : Envelope
{
[JsonConstructor]
Expand All @@ -37,6 +37,7 @@ public ConceptualMass(IList<Line> @skeleton, string @primaryUseCategory, System.
this.LocalCoordinateSystem = @localCoordinateSystem;
}


// Empty constructor
public ConceptualMass()
: base()
Expand Down
5 changes: 3 additions & 2 deletions Grids/SketchGrids/dependencies/Envelope.g.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------
// <auto-generated>
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v12.0.0.0) (http://NJsonSchema.org)
// Generated using the NJsonSchema v10.1.21.0 (Newtonsoft.Json v13.0.0.0) (http://NJsonSchema.org)
// </auto-generated>
//----------------------
using Elements;
Expand All @@ -23,7 +23,7 @@ namespace Elements

/// <summary>Represents one part of a building enclosure.</summary>
[JsonConverter(typeof(Elements.Serialization.JSON.JsonInheritanceConverter), "discriminator")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]
public partial class Envelope : GeometricElement
{
[JsonConstructor]
Expand All @@ -38,6 +38,7 @@ public Envelope(Profile @profile, double @elevation, double @height, Vector3 @di
this.FloorToFloorHeights = @floorToFloorHeights;
}


// Empty constructor
public Envelope()
: base()
Expand Down
5 changes: 3 additions & 2 deletions Grids/SketchGrids/dependencies/GridLinesOverride.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ public static List<T> CreateElements<T>(
if (elementToEdit != null)
{
resultElements.Remove(elementToEdit);
resultElements.Add(modifyElement(elementToEdit, editedElement));
Identity.AddOverrideIdentity(elementToEdit, editedElement);
var newElement = modifyElement(elementToEdit, editedElement);
resultElements.Add(newElement);
Identity.AddOverrideIdentity(newElement, editedElement);
}
}
}
Expand Down
16 changes: 7 additions & 9 deletions Grids/SketchGrids/dependencies/SketchGrids.Dependencies.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\..\..\Elements\Elements\src\Elements.csproj" />
<ProjectReference Include="..\..\..\..\Hypar\Hypar.Functions\src\Hypar.Functions.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>
</Project>
26 changes: 13 additions & 13 deletions Grids/SketchGrids/dependencies/SketchGridsInputs.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ namespace SketchGrids
{
#pragma warning disable // Disable all warnings

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class SketchGridsInputs : S3Args
public class SketchGridsInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public SketchGridsInputs(double @offsetDistanceFromConceptualMass, bool @addSkeletonGrids, Overrides @overrides, string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public SketchGridsInputs(double @offsetDistanceFromConceptualMass, bool @addSkeletonGrids, Overrides @overrides, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<SketchGridsInputs>();
if(validator != null)
Expand Down Expand Up @@ -61,7 +61,7 @@ public SketchGridsInputs(double @offsetDistanceFromConceptualMass, bool @addSkel

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class Overrides

Expand Down Expand Up @@ -98,7 +98,7 @@ public Overrides(OverrideAdditions @additions, OverrideRemovals @removals, IList

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class OverrideAdditions

Expand Down Expand Up @@ -127,7 +127,7 @@ public OverrideAdditions(IList<GridLinesOverrideAddition> @gridLines)

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class OverrideRemovals

Expand Down Expand Up @@ -156,7 +156,7 @@ public OverrideRemovals(IList<GridLinesOverrideRemoval> @gridLines)

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesOverride

Expand Down Expand Up @@ -191,7 +191,7 @@ public GridLinesOverride(string @id, GridLinesIdentity @identity, GridLinesValue

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesOverrideAddition

Expand Down Expand Up @@ -226,7 +226,7 @@ public GridLinesOverrideAddition(string @id, GridLinesIdentity @identity, GridLi

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesOverrideRemoval

Expand Down Expand Up @@ -257,7 +257,7 @@ public GridLinesOverrideRemoval(string @id, GridLinesIdentity @identity)

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesIdentity

Expand All @@ -284,7 +284,7 @@ public GridLinesIdentity(System.Guid @creationId)

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesValue

Expand All @@ -311,7 +311,7 @@ public GridLinesValue(Line @curve)

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v12.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public partial class GridLinesOverrideAdditionValue

Expand Down
3 changes: 0 additions & 3 deletions Grids/SketchGrids/dependencies/SketchGridsOutputs.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ namespace SketchGrids
public class SketchGridsOutputs: SystemResults
{


/// <summary>
/// Construct a SketchGridsOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public SketchGridsOutputs() : base()
{

}


}
}
2 changes: 1 addition & 1 deletion Grids/SketchGrids/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}
],
"element_types": [
"https://prod-api.hypar.io/schemas/ConceptualMass"
"https://schemas.hypar.io/ConceptualMass.json"
],
"model_output": "Grids",
"repository_url": "https://github.com/hypar-io/function",
Expand Down
10 changes: 5 additions & 5 deletions Grids/SketchGrids/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<SketchGridsInputs> store;
private UrlModelStore<SketchGridsInputs> store;

public async Task<SketchGridsOutputs> Handler(SketchGridsInputs args, ILambdaContext context)
public async Task<SketchGridsOutputs> Handler(SketchGridsInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -62,10 +61,11 @@ public async Task<SketchGridsOutputs> Handler(SketchGridsInputs args, ILambdaCon

if(this.store == null)
{
this.store = new S3ModelStore<SketchGridsInputs>(RegionEndpoint.USWest1);
this.store = new UrlModelStore<SketchGridsInputs>();
}


var l = new InvocationWrapper<SketchGridsInputs,SketchGridsOutputs>(store, SketchGrids.Execute);
var l = new InvocationWrapper<SketchGridsInputs,SketchGridsOutputs> (store, SketchGrids.Execute);
var output = await l.InvokeAsync(args);
return output;
}
Expand Down
8 changes: 3 additions & 5 deletions Grids/SketchGrids/src/SketchGrids.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\dependencies\SketchGrids.Dependencies.csproj" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
</Project>
10 changes: 3 additions & 7 deletions Grids/SketchGrids/test/SketchGrids.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\SketchGrids.csproj" />
</ItemGroup>

</Project>
</Project>

0 comments on commit 0d2e342

Please sign in to comment.