Route project files through prj/<name>/ instead of flat at repo root

Repo root had ~35 groups of .prj/.dat files loose alongside the build
system and source, all sharing one flat namespace. Centralize the new
prj/<name>/ convention inside AStack::loadWeights/saveWeights/
loadTrainingBatch/saveTrainingBatch and StackCreator::fromFile/toFile
(via a new AStack::projectDir() helper) -- these already have access to
the project name, so callers (poet.cpp, the GUI) need no changes at all;
they keep passing the same base directory they always did.

Filenames inside each project folder are unchanged (e.g.
prj/mnist_2/mnist_2.prj, prj/mnist_2/mnist_2.Layer.0.w.dat) -- only the
directory moves. Added Matutils::ensureDir() (mkdir -p equivalent; no
std::filesystem in C++11) since ofstream won't create directories, used
wherever a project is saved for the first time.

File migration for existing projects is a separate commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016K8Gu7Qejd11JbdiHZqYAs
This commit is contained in:
2026-07-27 14:41:05 +02:00
co-authored by Claude Sonnet 5
parent 4cf5f15555
commit ca27e1e705
4 changed files with 48 additions and 10 deletions
+4 -1
View File
@@ -89,7 +89,10 @@ private:
arma::mat m_trainingBatch;
size_t m_numLayers;
void updateNumLayers();
// Every project's files live under {dir}/prj/{m_name}/, not flat at {dir}.
std::string projectDir(const std::string &dir) const;
};
#endif /* ASTACK_HPP */