Skip to content

Commit

Permalink
Add Ultralytics actions workflow in format.yml (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: glenn-jocher <[email protected]>
  • Loading branch information
UltralyticsAssistant and glenn-jocher authored Jan 1, 2024
1 parent cbbe540 commit 6ca0e63
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 17 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Ultralytics 🚀, AGPL-3.0 license
# Ultralytics Format Workflow
# This workflow automatically formats code and documentation in pull requests and pushes to main branch

name: Ultralytics Actions

on:
push:
branches: [main,master]
pull_request:
branches: [main,master]

jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Run Ultralytics Formatting Actions
uses: ultralytics/actions@main
2 changes: 1 addition & 1 deletion C/solidanglec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void cfunction(double* X, double* P, double* N, double* pa, double* al, double*
dz = P[j+2*MP] - z;
dotproduct = N[j]*dx + N[j+MP]*dy + N[j+2*MP]*dz;

if (dotproduct>0) // possible transmition
if (dotproduct>0) // possible transmission
{
rs = dx*dx + dy*dy + dz*dz;
r[k] = sqrt(rs);
Expand Down
Binary file modified LIBRARIES/MATERIALS/CERN Index of Refraction.pdf
Binary file not shown.
Binary file modified LIBRARIES/MATERIALS/NIMA522-439PKL.pdf
Binary file not shown.
Binary file modified LIBRARIES/MATERIALS/OlegThesis.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion ML/FASTNEUTRON/fcnplotneutronMC.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
a(:,4) = MC.xhat(:,10,i) - MC.xhat(:,4,i) > 1; %dt > 1ns
a(:,5) = fcnrange(MC.xhat(:,1:3,i) - MC.xhat(:,7:9,i)) > 10; %dx > 10mm
a(:,6) = MC.xhat(:,5,i)>0.200; %.3 %first bounce > 100keV
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greather than 0.20
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greater than 0.20
a(:,8) = MC.xhat(:,5,i)./MC.xhat(:,18,i) < .9; %dE1./E0 < 0.9
a(:,9) = MC.xhat(:,5,i)./MC.xhat(:,18,i) > .1; %dE1./E0 > 0.1
a(:,10) = MC.xhat(:,18,i) < 6; %(MeV) E0<20MeV
Expand Down
2 changes: 1 addition & 1 deletion ML/FASTNEUTRON/fcnplotneutronTS.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
a(:,4) = MC.xhat(:,10,i) - MC.xhat(:,4,i) > 1; %dt > 1ns
a(:,5) = fcnrange(MC.xhat(:,1:3,i) - MC.xhat(:,7:9,i)) > 10; %dx > 10mm
a(:,6) = MC.xhat(:,5,i)>0.200; %.3 %first bounce > 100keV
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greather than 0.20
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greater than 0.20
a(:,8) = MC.xhat(:,5,i)./MC.xhat(:,18,i) < .9; %dE1./E0 < 0.9
a(:,9) = MC.xhat(:,5,i)./MC.xhat(:,18,i) > .1; %dE1./E0 > 0.1
%a(:,10) = fcninsidedetector(MC.xhat(:,1:3,i), input, 10); %P1 wall cut
Expand Down
2 changes: 1 addition & 1 deletion ML/fcnoptimizerkr.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function k = fcnoptimizerkr(input,output)
%reduced version of optimzer constants using only active pixels
%reduced version of optimizer constants using only active pixels
k = fcnoptimizerk(input,output(1).N);

ti = output.t~=0;
Expand Down
6 changes: 3 additions & 3 deletions MTC/DataAnalysis/plotAnalysis.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
c = ones(size(X,1),1);
end

i=any(c==[1 2 4 5],2); fprintf('%g category (1,2,4,5) events over %g runs for %.4g days of reactor ON live-time\n',sum(i),numel(unique(X(i,1))),livetime(X(i,:)));
i=any(c==6,2); fprintf('%g category 6 events over %g runs for %.4g days of reactor OFF live-time\n',sum(i),numel(unique(X(i,1))),livetime(X(i,:)));
i=any(c==[1 2 4 5],2); fprintf('%g category (1,2,4,5) events over %g runs for %.4g days of reactor ON live-time\n',sum(i),numel(unique(X(i,1))),lifetime(X(i,:)));
i=any(c==6,2); fprintf('%g category 6 events over %g runs for %.4g days of reactor OFF live-time\n',sum(i),numel(unique(X(i,1))),lifetime(X(i,:)));
i=any(c==[1 2 4 5],2);
X=X(i,:); ne=sum(i);

Expand Down Expand Up @@ -215,7 +215,7 @@ function gfit(X,filename)
fclose(fid);
end

function days=livetime(X)
function days=lifetime(X)
runs=unique(X(:,1)); n=numel(runs); T=X(:,3)/1E6; i=T~=0 & ~isnan(T); T=T(i); X=X(i,:); t=0;
for i=1:n
ti=T(X(:,1)==runs(i));
Expand Down
2 changes: 1 addition & 1 deletion plotFunctions/fcnplotdetectorprojection.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function fcnplotdetectorprojection(input,iap,fxva,p0,proj,label)

i=find(cm(:,1)<-100 & cm(:,2)>100); %j = cm(i,1)==-180; j=i(j); i=i(~j); cm(j,[1 4]) = cm(j,[1 4])+360;
if any(i) %pixels wrapping around the 180deg line
if all(p0==0) %we can split pixels, but p0 must be in center of detector to make left and right symetric!
if all(p0==0) %we can split pixels, but p0 must be in center of detector to make left and right symmetric!
cm(i,2:3)=-180; cm=[cm; -cm(i,:)]; rm=[rm; rm(i,:)]; fxva=[fxva; fxva(i)]; %SPLIT PIXELS IN HALF LEFT AND RIGHT
else
cm(i,2:3) = cm(i,2:3)-360; %EXTEND WRAPPED PIXELS TO THE LEFT
Expand Down
2 changes: 1 addition & 1 deletion tests/NTC/fcndisambiguate.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
t = (t1+t2 - l/speed)/2; %ns
y = interp1c(1:pmt.strips,pmt.stripx, (L(:,2)+R(:,2))/2); %mm from center

%BREAK DOWN LARGE PULSES INTO SMALLER SINLGES
%BREAK DOWN LARGE PULSES INTO SMALLER SINGLES
a=floor( (L(:,3)+R(:,3))/2/dSPRamplitude ); ma=max(a);
if ma>1
c=cell(ma,1); tb=c; xb=c; yb=c; tb{1}=t; xb{1}=x; yb{1}=y;
Expand Down
4 changes: 2 additions & 2 deletions tests/Plutonium Simulation/fcnML123.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
om1 = ones(input.nxy^2, input.nrp);
L = zeros(input.nxy^2, input.nrp);
ov1 = ones(input.nxy^2, 1);
nbatch = 100; %number of measurments per batch max
nbatch = 100; %number of measurements per batch max
sk = table.mev.de/4/pi; %stabilizing constant
pdfur = zeros(input.nxy^2, nbatch);
vnrp = 1:input.nrp;
Expand Down Expand Up @@ -65,7 +65,7 @@

%ML2-------------------------------------------------------------------
if flags.status.ML2 && Ci>0
zn = accumarray(d1.z.eic, 1, [table.mev.ne 1]); %measurments per bin;
zn = accumarray(d1.z.eic, 1, [table.mev.ne 1]); %measurements per bin;
epdf = e(1)*d1.epdf.kr + e(2)*d1.epdf.mantle + e(3)*d1.epdf.crust + e(4)*d1.epdf.fastneutron + e(5)*d1.epdf.accidental + e(6)*d1.epdf.cosmogenic;
if flags.status.CRLB
zn = d1.epdf.all*table.mev.de;
Expand Down
6 changes: 3 additions & 3 deletions tests/Plutonium Simulation/fcnfindplutonium2.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@
function [d, s, DEM] = fcngetpositions()
%GET GE IMAGE -------------------------------------------------------------
%cam.ssge = [8 2560-720-77 1280 720]; %1080x720; 27" 27" dual monitor hack
%hge = actxserver('googleearth.ApplicationGE'); %Create a COM server running Google Earth
%DEM = fcngetGEDEM(hge,70); fcnFinishStreamProgress(hge); x=getscreen(cam.ssge); DEM.cdata = x.cdata; save DEMHamburg.mat DEM
%he = actxserver('googleearth.ApplicationGE'); %Create a COM server running Google Earth
%DEM = fcngetGEDEM(he,70); fcnFinishStreamProgress(he); x=getscreen(cam.ssge); DEM.cdata = x.cdata; save DEMHamburg.mat DEM
%MOL Cosmos, Panama

load DEMHamburg
Expand Down Expand Up @@ -229,7 +229,7 @@
a(:,4) = MC.xhat(:,10,i) - MC.xhat(:,4,i) > 1; %dt > 1ns
a(:,5) = fcnrange(MC.xhat(:,1:3,i) - MC.xhat(:,7:9,i)) > 10; %dx > 10mm
a(:,6) = MC.xhat(:,5,i)>0.200; %.3 %first bounce > 100keV
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greather than 0.20
a(:,7) = MC.xhat(:,6,i)./MC.xhat(:,12,i) > .2; %dE1/dE2 must be greater than 0.20
a(:,8) = MC.xhat(:,5,i)./MC.xhat(:,18,i) < .9; %dE1./E0 < 0.9
a(:,9) = MC.xhat(:,5,i)./MC.xhat(:,18,i) > .1; %dE1./E0 > 0.1
a(:,10) = MC.xhat(:,5,i)<3; %.3 %first bounce > 100keV
Expand Down
Binary file modified tests/Reactor Simulation/Muons/rastin_JoPG10_1984_1609.pdf
Binary file not shown.
Binary file modified tests/Reactor Simulation/Neutrons/Goldhagen IEEE.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[angstroms x]

%[nuetron_angstroms, neutron_MeV, 'Linear Attenuation Factor (cm^-1)']
tabel=[ 8.941 1.0233e-09 4.690
table=[ 8.941 1.0233e-09 4.690
6.3917 2.0024e-09 4.655
4.6935 3.7135e-09 4.632
3.6366 6.1854e-09 4.618
Expand Down
2 changes: 1 addition & 1 deletion tests/Reactor Simulation/fcnReactorCollection.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
flux(4) = 51 * area * rp/20; %Reactor Gammas/s
flux(5) = 25 * area; %Atmospheric Gammas/s
flux(6) = .0165 * area; %Muons/s .0165/cm^2/s
%flux = flux.*(1-[0 .9869 .9869 .9923 .9923 .6242]'); %Sheilding fractions
%flux = flux.*(1-[0 .9869 .9869 .9923 .9923 .6242]'); %Shielding fractions


%flux = [snuebar.n, 0, 0.05, 0, 13, 4]';
Expand Down
2 changes: 1 addition & 1 deletion tests/Reactor Simulation/fcngetobservedspectra.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
case {4,5} %reactor and atmospheric gammas
MC = getcandidatefractions(fnames{fi});

pf = getGammaTransInLead(MC.MeVVector, shield.lead)'; sf = 1-pf; %pass and sheilded fractions (5cm lead)
pf = getGammaTransInLead(MC.MeVVector, shield.lead)'; sf = 1-pf; %pass and shielded fractions (5cm lead)
MC.fraction = MC.fraction.*pf;
MC.fraction(:,end+1) = sf;
legendstr{9} = sprintf('Shielded %.0fcm lead',shield.lead);
Expand Down
Binary file modified tests/Reactor Simulation/pdfs/4 Particle Efficiencies v2.pdf
Binary file not shown.
Binary file modified tests/Reactor Simulation/pdfs/4 particle Efficiencies v3.pdf
Binary file not shown.
Binary file modified tests/Reactor Simulation/pdfs/4 particle Efficiencies v6.pdf
Binary file not shown.

0 comments on commit 6ca0e63

Please sign in to comment.