Skip to content

Commit

Permalink
Merge pull request #2295 from AllenInstitute/feature/2295-code-style
Browse files Browse the repository at this point in the history
Fix code style
  • Loading branch information
t-b authored Nov 17, 2024
2 parents 74d6ef9 + 533df91 commit 0d3abe3
Show file tree
Hide file tree
Showing 207 changed files with 4,433 additions and 6,978 deletions.
4 changes: 3 additions & 1 deletion .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ dfab4ae4f861d0151aac7b36a1efa3a7b6b8adee
167ec8e726283057a4571f3b4f22a67817cdadf4
# remove space at beginning of line
12707f25cff72d59c02f38e676ce1286e941ecb9
# format all files with ipt
# format all files with ipt (0.4.0)
2b366d3c8acdf4b3071d7ed031f4754992883f42
# format all files with ipt (0.6.0) and linting
111c14281a4d12571bf9492b3513993c6b16e4b6
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: actions/checkout@v4
# no need to checkout submodules or the full history
- name: Download ipt binary from server
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.4.0/ipt.exe"
run: curl -o ipt.exe "https://byte-physics.de/public-downloads/aistorage/transfer/ipt/0.6.0/ipt.exe"
- name: IPT version
run: ./ipt.exe --version
- name: Format code
Expand Down
33 changes: 11 additions & 22 deletions Packages/Conversion/MIES_MassExperimentProcessing.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ End

static StrConstant kPackageName = "MIES PXP to NWBv2"
static StrConstant kPreferencesFileName = "ProcessPrefsMIESNWBv2.bin"
static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file.
static Constant kPrefsRecordID = 0 // The recordID is a unique number identifying a record within the preference file.

static Structure MultiExperimentProcessPrefs
uint32 version // Prefs version
Expand All @@ -58,8 +58,7 @@ EndStructure
static Constant kPrefsVersionNumber = 102

// Loads preferences into our structure.
static Function LoadPackagePrefs(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function LoadPackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs)

variable currentPrefsVersion = kPrefsVersionNumber

Expand All @@ -79,14 +78,12 @@ static Function LoadPackagePrefs(prefs)
End

// Saves our structure to preferences.
static Function SavePackagePrefs(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function SavePackagePrefs(STRUCT MultiExperimentProcessPrefs &prefs)

SavePackagePreferences kPackageName, kPreferencesFileName, kPrefsRecordID, prefs
End

static Function ProcessCurrentExperiment(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function ProcessCurrentExperiment(STRUCT MultiExperimentProcessPrefs &prefs)

variable jsonID, index
string outputFilePath, inputFile, outputFolder
Expand Down Expand Up @@ -133,8 +130,7 @@ static Function ProcessCurrentExperiment(prefs)
StoreJSON(prefs, jsonID)
End

static Function PerformMiesTasks(outputFilePath)
string outputFilePath
static Function PerformMiesTasks(string outputFilePath)

string folder, message
variable nwbVersion, error
Expand Down Expand Up @@ -164,8 +160,7 @@ static Function IsAppropriateExperiment()
End

// Returns full path to the next experiment file to be loaded or "" if we are finished.
static Function/S FindNextExperiment(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function/S FindNextExperiment(STRUCT MultiExperimentProcessPrefs &prefs)

variable jsonID, index

Expand All @@ -183,8 +178,7 @@ static Function/S FindNextExperiment(prefs)
End

// Caller needs to release json
static Function GetJSON(prefs)
STRUCT MultiExperimentProcessPrefs &prefs
static Function GetJSON(STRUCT MultiExperimentProcessPrefs &prefs)

string data, fname

Expand All @@ -194,9 +188,7 @@ static Function GetJSON(prefs)
End

// json will be released
static Function StoreJSON(prefs, jsonID)
STRUCT MultiExperimentProcessPrefs &prefs
variable jsonID
static Function StoreJSON(STRUCT MultiExperimentProcessPrefs &prefs, variable jsonID)

string data = JSON_Dump(jsonID, indent = 2)

Expand All @@ -208,8 +200,7 @@ End
// Posts commands to Igor's operation queue to close the current experiment and open the next one.
// Igor executes operation queue commands when it is idling - that is, when it is not running a
// function or operation.
static Function PostLoadNextExperiment(nextExperimentFullPath)
string nextExperimentFullPath
static Function PostLoadNextExperiment(string nextExperimentFullPath)

ASSERT(FileExists(nextExperimentFullPath), "Experiment must exist")

Expand All @@ -225,9 +216,7 @@ End

// This is the hook function that Igor calls whenever a file is opened. We use it to
// detect the opening of an experiment and to call our ProcessCurrentExperiment function.
static Function AfterFileOpenHook(refNum, file, pathName, type, creator, kind)
variable refNum, kind
string file, pathName, type, creator
static Function AfterFileOpenHook(variable refNum, string file, string pathName, string type, string creator, variable kind)

STRUCT MultiExperimentProcessPrefs prefs

Expand Down Expand Up @@ -314,7 +303,7 @@ Function StartMultiExperimentProcessWrapper()
// 64: Ignore + and - in the alphanumeric sort so that "Text-09" sorts before "Text-10". Set options to 80 or 81.
files = SortList(files, FILE_LIST_SEP, 80)

WAVE/T/Z inputPXPs = ListToTextWave(files, FILE_LIST_SEP)
WAVE/Z/T inputPXPs = ListToTextWave(files, FILE_LIST_SEP)

jsonID = JSON_New()
JSON_AddWave(jsonID, "/inputFiles", inputPXPs)
Expand Down
2 changes: 2 additions & 0 deletions Packages/MIES/MIES_AcquisitionStateHandling.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/// @brief Get the acquisition state as string
Function/S AS_StateToString(variable acqState)

switch(acqState)
case AS_INACTIVE:
return "AS_INACTIVE"
Expand Down Expand Up @@ -201,6 +202,7 @@ End
///
/// Requires that they were recorded with AS_RecordStateTransition().
Function/WAVE AS_GenerateEncounteredTransitions()

variable numEntries, i, j

WAVE acqStateTracking = GetAcqStateTracking()
Expand Down
Loading

0 comments on commit 0d3abe3

Please sign in to comment.