Skip to content

Commit 7a5f66a

Browse files
Repository hygiene updates (#1)
* add workflow * standard SAM-BIM legal files * update readme and repo-hygiene * Update SAM Analytical.csproj
1 parent f1e4cb0 commit 7a5f66a

8 files changed

Lines changed: 246 additions & 57 deletions

File tree

.github/CODEOWNERS

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
1-
# Lines starting with '#' are comments.
2-
# Each line is a file pattern followed by one or more owners.
1+
# CODEOWNERS
2+
# SAM-BIM – repository ownership definition
33
# https://github.blog/2017-07-06-introducing-code-owners/
44

5-
# SAM REPO CODEOWNERS
6-
7-
# default global
8-
# These owners will be the default owners for everything in the repo
9-
5+
# Default owners for the entire repository
106
* @michaldengusiak @ZiolkowskiJakub
117

12-
13-
# project owners
14-
# Order is important. The last matching pattern has the most precedence.
15-
# So if a pull request only touches javascript files, only these owners
16-
# will be requested to review.
17-
18-
/SAM @michaldengusiak @ZiolkowskiJakub
19-
/SAM_BHoM @michaldengusiak @ZiolkowskiJakub
20-
/SAM_Excel @michaldengusiak @ZiolkowskiJakub
21-
/SAM_LadybugTools @michaldengusiak @ZiolkowskiJakub
22-
/SAM_Revit @michaldengusiak @ZiolkowskiJakub
23-
/SAM_Tas @michaldengusiak @ZiolkowskiJakub
24-
/SAM_Topologic @michaldengusiak @ZiolkowskiJakub
25-
/SAM_UI @michaldengusiak @ZiolkowskiJakub
26-
/SAM_gbXML @michaldengusiak @ZiolkowskiJakub
27-
/SAM_GEM @michaldengusiak @ZiolkowskiJakub
28-
/SAM_Template @michaldengusiak @ZiolkowskiJakub
29-
30-
31-
# You can also use email addresses if you prefer.
8+
# Governance & workflow files (always require both owners)
9+
/CODEOWNERS @michaldengusiak @ZiolkowskiJakub
10+
/.github/ @michaldengusiak @ZiolkowskiJakub

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
### NOTE: Depends on
2-
<!-- Link to any additional PRs in other repos required for this PR to function -->
3-
<!-- Delete this section if not needed -->
1+
### Summary
2+
What is delivered and why (1–3 sentences).
43

5-
6-
### Issues addressed by this PR
7-
<!-- Add reference(s) to issue(s) solved by this PR. Please use keyword Fixes as per https://help.github.com/articles/closing-issues-using-keywords/ -->
8-
9-
Fixes #
10-
11-
<!-- Add short description of what has been fixed -->
12-
13-
14-
### Test files
15-
<!-- Link to test files to validate the proposed changes -->
16-
17-
18-
### Additional comments
19-
<!-- As required -->
4+
### Validation
5+
How to verify or test the change.

.github/workflows/build.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Build (Windows)
2+
3+
on:
4+
push:
5+
branches: [ "master", "main" ]
6+
pull_request:
7+
branches: [ "master", "main" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
# Guard: if this workflow ever gets merged upstream (e.g. HoareLea),
13+
# it will show as "skipped" there and won't break their CI.
14+
if: github.repository_owner == 'SAM-BIM'
15+
runs-on: windows-2022
16+
17+
env:
18+
MSBUILDDISABLENODEREUSE: "1"
19+
ORG_NAME: "SAM-BIM"
20+
# >>> CHANGE THIS PER REPO <<<
21+
# Examples: SAM, SAM_gbXML, SAM_GEM, SAM_Tas, ...
22+
REPO_NAME: "SAM_MachineLearning"
23+
24+
steps:
25+
- name: Checkout this repo
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
path: ${{ env.REPO_NAME }}
30+
31+
- name: Setup .NET 8
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: "8.x"
35+
36+
- name: Setup MSBuild
37+
uses: microsoft/setup-msbuild@v2
38+
39+
- name: Clone dependency repos (siblings)
40+
shell: pwsh
41+
run: |
42+
$ErrorActionPreference = 'Stop'
43+
44+
$org = '${{ env.ORG_NAME }}'
45+
$repo = '${{ env.REPO_NAME }}'
46+
47+
# >>> ADJUST BUILD ORDER HERE IF NEEDED <<<
48+
# Keep the current repo LAST.
49+
$buildOrder = @(
50+
$repo
51+
)
52+
53+
# Clone everything except the last one (already checked out by Actions)
54+
$deps = $buildOrder[0..($buildOrder.Count-2)]
55+
foreach ($r in $deps) {
56+
if (Test-Path $r) { continue }
57+
Write-Host "Cloning https://github.com/$org/$r.git"
58+
git clone --depth 1 "https://github.com/$org/$r.git" $r
59+
}
60+
61+
# Ensure ReferencePath exists even before SAM_Windows builds
62+
New-Item -ItemType Directory -Force -Path "SAM_Windows\build" | Out-Null
63+
64+
- name: Restore + Rebuild in order (CI props like SAM_Deploy)
65+
shell: pwsh
66+
run: |
67+
$ErrorActionPreference = 'Stop'
68+
69+
$repo = '${{ env.REPO_NAME }}'
70+
$windowsRef = (Resolve-Path 'SAM_Windows\build').Path
71+
72+
# IMPORTANT: keep these as an ARRAY of args (do NOT join into one string)
73+
$common = @(
74+
'/m:1'
75+
'/nr:false'
76+
'/v:m'
77+
'/p:Configuration=Release'
78+
'/p:UseSharedCompilation=false'
79+
'/p:RunPostBuildEvent=OnOutputUpdated'
80+
"/p:ReferencePath=$windowsRef"
81+
)
82+
83+
# If you really want Platform, use QUOTED Any CPU:
84+
# $common += '/p:Platform="Any CPU"'
85+
86+
# Same build order as above (keep repo LAST)
87+
$buildOrder = @(
88+
$repo
89+
)
90+
91+
# Convert build order -> solution paths (robust: first .sln in each folder)
92+
$solutions = foreach ($r in $buildOrder) {
93+
$sln = Get-ChildItem -Path $r -Filter *.sln -File | Select-Object -First 1
94+
if (-not $sln) { throw "No .sln found under: $r" }
95+
$sln.FullName
96+
}
97+
98+
foreach ($sln in $solutions) {
99+
Write-Host "==> Restore: $sln"
100+
& msbuild $sln /t:Restore @common
101+
}
102+
103+
foreach ($sln in $solutions) {
104+
Write-Host "==> Rebuild: $sln"
105+
& msbuild $sln /t:Rebuild @common
106+
}
107+
108+
- name: Upload build folders (optional)
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: ${{ env.REPO_NAME }}-build-folders
112+
path: |
113+
**\build\*
114+
if-no-files-found: warn

.github/workflows/spdx-check.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: SPDX + Copyright header check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
spdx:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Check header in changed .cs files
15+
run: |
16+
set -e
17+
BASE="${{ github.event.pull_request.base.sha }}"
18+
HEAD="${{ github.event.pull_request.head.sha }}"
19+
20+
FILES=$(git diff --name-only "$BASE" "$HEAD" -- '*.cs' || true)
21+
22+
if [ -z "$FILES" ]; then
23+
echo "No C# files changed."
24+
exit 0
25+
fi
26+
27+
MISSING=""
28+
for f in $FILES; do
29+
HEADBLOCK=$(head -n 6 "$f")
30+
31+
echo "$HEADBLOCK" | grep -q "// SPDX-License-Identifier: LGPL-3.0-or-later" || MISSING="$MISSING $f"
32+
echo "$HEADBLOCK" | grep -q "// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors" || MISSING="$MISSING $f"
33+
done
34+
35+
if [ -n "$MISSING" ]; then
36+
echo "❌ Missing required header in:"
37+
for f in $MISSING; do echo " - $f"; done
38+
echo ""
39+
echo "Each changed .cs file must start with:"
40+
echo "// SPDX-License-Identifier: LGPL-3.0-or-later"
41+
echo "// Copyright (c) 2020–2026 Michal Dengusiak & Jakub Ziolkowski and contributors"
42+
exit 1
43+
fi
44+
45+
echo "✅ SPDX + copyright headers OK."

Application/SAM Analytical/SAM Analytical.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</ItemGroup>
1515

1616
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
17-
<Exec Command="copy /Y &quot;$(SolutionDir)SAM_MachineLearning\SAM.Analytical.MachineLearning\MachineLearningModels\SpaceType.mlnet&quot; &quot;$(ProjectDir)$(OutDir)SpaceType.mlnet&quot;" />
17+
<Exec Command="set &quot;filePath=$(SolutionDir)SAM_MachineLearning\SAM.Analytical.MachineLearning\MachineLearningModels\SpaceType.mlnet&quot;&#xA; &#xA;if exist &quot;%25filePath%25&quot; (&#xA; if not exist &quot;$(TargetDir)&quot; mkdir &quot;$(TargetDir)&quot;&#xA; copy /Y &quot;%25filePath%25&quot; &quot;$(TargetDir)SpaceType.mlnet&quot;&#xA;)" />
1818
</Target>
1919

2020
</Project>

COPYRIGHT_HEADER.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: LGPL-3.0-or-later
2+
// Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors

NOTICE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SAM-BIM — Sustainable Analytical Model (SAM)
2+
3+
Copyright © 2020–2026
4+
Michal Dengusiak & Jakub Ziolkowski and contributors
5+
6+
This repository is part of the SAM (Sustainable Analytical Model) toolkit.
7+
8+
License
9+
This project is licensed under the GNU Lesser General Public License
10+
v3.0 or later (LGPL-3.0-or-later). See the LICENSE file for details.
11+
12+
Attribution and third-party software
13+
Each contributor retains copyright to their respective contributions.
14+
The project history (Git) records authorship and provenance of all changes.
15+
16+
This repository may include or depend on third-party open-source components.
17+
Where applicable, third-party notices and license information are provided in:
18+
- THIRD_PARTY.md (if present)
19+
- LICENSE (and any license files within third-party source folders)

README.md

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,63 @@
1-
# SAM_Template
1+
[![Build (Windows)](https://github.com/SAM-BIM/SAM_MachineLearning/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/SAM-BIM/SAM_MachineLearning/actions/workflows/build.yml)
2+
[![Installer (latest)](https://img.shields.io/github/v/release/SAM-BIM/SAM_Deploy?label=installer)](https://github.com/SAM-BIM/SAM_Deploy/releases/latest)
23

3-
<a href="https://github.com/HoareLea/SAM_Excel"><img src="https://github.com/HoareLea/SAM/blob/master/Grasshopper/SAM.Core.Grasshopper/Resources/SAM_Small.png" align="left" hspace="10" vspace="6"></a>
4+
# SAM_MachineLearning
45

5-
**SAM** is part of SAM Toolkit that is designed to help engneers to create Analytical Model. Welcome and let's make the opensource journey continue. :handshake:
6+
<a href="https://github.com/SAM-BIM/SAM">
7+
<img src="https://github.com/SAM-BIM/SAM/blob/master/Grasshopper/SAM.Core.Grasshopper/Resources/SAM_Small.png"
8+
align="left" hspace="10" vspace="6">
9+
</a>
10+
11+
**SAM_MachineLearning** is part of the **SAM (Sustainable Analytical Model) Toolkit**
12+
an open-source collection of tools designed to help engineers create, manage,
13+
and process analytical building models for energy and environmental analysis.
14+
15+
This repository is dedicated to **experimental work and prototyping involving machine learning**
16+
within the SAM ecosystem.
17+
It provides a sandbox for exploring data-driven methods, learning-based models,
18+
and hybrid analytical–machine-learning workflows applied to building performance analysis.
19+
20+
The content of this repository may evolve rapidly and is intended primarily
21+
for research, experimentation, and proof-of-concept development.
22+
23+
---
24+
25+
## Scope
26+
27+
Typical areas of investigation include:
28+
- application of machine learning to SAM analytical data
29+
- surrogate and reduced-order models
30+
- pattern recognition and clustering in simulation results
31+
- hybrid workflows combining physics-based models and ML approaches
32+
33+
The repository does not represent a stable API and may change as experiments progress.
34+
35+
---
636

737
## Resources
8-
* [Wiki](https://github.com/HoareLea/SAM/wiki)
38+
- 📘 **SAM Wiki:** https://github.com/SAM-BIM/SAM/wiki
39+
- 🧠 **SAM Core:** https://github.com/SAM-BIM/SAM
40+
- 🧰 **Installers:** https://github.com/SAM-BIM/SAM_Deploy
41+
42+
---
43+
44+
## Development notes
45+
46+
- Target framework: **.NET / C#** (additional tools or languages may be explored)
47+
- Experimental code may not follow full SAM module conventions
48+
- New or modified `.cs` files must include the SPDX header from `COPYRIGHT_HEADER.txt`
49+
50+
---
951

10-
## Installing
52+
## Licence
1153

12-
To install **SAM** from .exe just download and run [latest installer](https://github.com/HoareLea/SAM_Deploy/releases) otherwise rebuild using VS [SAM](https://github.com/HoareLea/SAM)
54+
This repository is free software licensed under the
55+
**GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later)**.
1356

14-
## Licence ##
57+
Each contributor retains copyright to their respective contributions.
58+
The project history (Git) records authorship and provenance of all changes.
1559

16-
SAM is free software licenced under GNU Lesser General Public Licence - [https://www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html)
17-
Each contributor holds copyright over their respective contributions.
18-
The project versioning (Git) records all such contribution source information.
19-
See [LICENSE](https://github.com/HoareLea/SAM_Template/blob/master/LICENSE) and [COPYRIGHT_HEADER](https://github.com/HoareLea/SAM/blob/master/COPYRIGHT_HEADER.txt).
60+
See:
61+
- `LICENSE`
62+
- `NOTICE`
63+
- `COPYRIGHT_HEADER.txt`

0 commit comments

Comments
 (0)