PhysiCell icon indicating copy to clipboard operation
PhysiCell copied to clipboard

BioFVM namespace usage

Open eOnofri04 opened this issue 3 years ago • 4 comments
trafficstars

Hi,

I am developing some simulations building upon PhysiCell.

I might be wrong with the import procedure of the sources, however, including PhysiCell header files forces me to include BioFVM namespace even when PhysiCell's is not included. It is in fact the case from three .h files, e.g. PhysiCell_cell.h that is usually imported via `#include "./core/PhysiCell.h".

In my personal fork, I have solved this issue by moving such usings inside PhysiCell's namespace (actually two lines down in a bunch of files).

I think that could also be your initial idea since in the Documentation you suggest here to include PhysiCell's and BioFVM's namespaces.

Best, Elia

eOnofri04 avatar Apr 12 '22 14:04 eOnofri04

Thank you.

Yes, this reflects prior history when the projects were more independent.

We could make this fix, but is anything broken in its current state of two namespaces?

(Sorry for the naive question: I'm trying to understand the implications of the problem, as it has not caused us any issues to date across platforms and projects.)

MathCancer avatar Mar 01 '23 22:03 MathCancer

Your question makes totally sense.

The namespace import problem will rarely cause effective problems in implementation rather than (possibly) having some naming conflict. The actual effect is simply that things are "visible"/callable even when they should be not (like everything is global). However, since we are trying to develop a module that uses PhysiCell by wrapping it, it totally makes sense that importing such a module would not allow to directly modify internal values in, say, BioFVM.

Thanks again for your work, Best, Elia

eOnofri04 avatar Mar 02 '23 01:03 eOnofri04

Thanks!

Hmm, I'll take another look. Thank you for the helpful explanation.

Since PhysiCell builds off of / extends BioFVM, it can't be used without things in the BioFVM namespace. (They could with a lot of careful cleanup, but in practice they are so intertwined that it makes sense for them to be in the same namespace.)

So, I think pulling the "using" into the PhysiCell namespace makes tremendous sense. I'm going to put this on my testing radar for the next release (I'd want ot put it into 1.11.1, after we get 1.11.0 out the door today or tomorrow.)

Thank you! And I'm super intrigued at the wrapper you're working on!!

MathCancer avatar Mar 20 '23 03:03 MathCancer