patham9 / NACE

Non-Axiomatic Causal Explorer
MIT License
15 stars 4 forks source link

Refactor #2

Closed bowen-xu closed 10 months ago

bowen-xu commented 10 months ago

Seperate nace.py into several files for maintainability.

patham9 commented 10 months ago

Unfortunately I had already started modularizing, just not yet commited. But let's see how we can combine it as you have some potential improvements in there which I don't have! Does the Numpy dependence and custom deepcopy make it faster? If so, how much?

bowen-xu commented 10 months ago

Does the Numpy dependence and custom deepcopy make it faster? If so, how much?

Currently no. It makes the program 15% slower. But it would be more convenient to use numpy if you consider to optimize the code. For example, in localObserve function, we can use subscripts to access an area of the array, and it would be much faster than using loops. Of course it's not necessary to use numpy.

bowen-xu commented 10 months ago

@patham9 I'll close this pr and wait for your update on the modularized code.

patham9 commented 10 months ago

I have added it, I also used part of your PR like the separate prettyprint.py I didn't have before.