LettError/MutatorMath

Maybe DesignSpaceDocumentReader can execute up to self.readSources()

Closed this issue · 4 comments

getSourcePaths needs to interpret a part of the designspace to find the sources. Now I also want to read some other data without proceeding all the way through building the instances. So, would it be acceptable to add

        tree = ET.parse(self.path)        
        self.root = tree.getroot()
        self.readVersion()
        assert self.documentFormatVersion == 3
        self.warpDict = None
        self.readWarp()
        self.readSources()

..to the init? It gives the DesignSpaceDocumentReader some more data to work with, it does not add that much work to the instantiation but it will reduce duplication.

I also needed the same (just loading, no building), so I ended up reimplementing the parts I needed in varLib.

@LettError just realized that your proposed change was partially implemented in d3d205a
Do you want a PR to move the rest?

If you could do that, that would be great!

done