nova-todo icon indicating copy to clipboard operation
nova-todo copied to clipboard

Add configuration option to run the extension only in the directories specified

Open uicowboy opened this issue 3 years ago • 2 comments

Thanks for this extension!

One of the projects I work in has 100+ different directories, but my team only works in a handful of them. It would be really useful if the extension's settings exposed an option to "run only in the specified directories". Currently, there is an option to say which directories should be ignored, but the other way around would be great for large projects. I would imagine this could also boost the performance of the app since it would have a lot less to monitor.

How doable would this be for you? Thanks again.

uicowboy avatar Oct 11 '21 05:10 uicowboy

Indeed, however, I am not sure whether it should be a default of both merged? Consider a case where a user has done pbc = (T, T, F) but then set nsc = [3, 1, 1]?

However, I can see that the documentation specifies periodic direction, so if this is clarified in the doc-string, that pbc is used, then fine!

zerothi avatar Apr 26 '24 19:04 zerothi

Perhaps there are other places:

~/codes/sisl/src % grep "nsc > 1" **/*.py                                                                                                                                                main
sisl/_core/geometry.py:            axes = (self.lattice.nsc > 1).nonzero()[0]
sisl/_core/geometry.py:        elif np.any(self.nsc > 1):
sisl/_core/geometry.py:        periodic system (where ``self.nsc > 1`` or `periodic` is true).
sisl/_core/geometry.py:            directions are only where ``self.nsc > 1 & self.pbc``.
sisl/_core/geometry.py:            periodic = np.logical_and(self.pbc, self.nsc > 1)
sisl/_core/geometry.py:            pbc=geom.nsc > 1,
sisl/_core/lattice.py:            if changed.any() and (~bc).all() and nsc > 1:
sisl/_core/sparse_geometry.py:            axes = (self.lattice.nsc > 1).nonzero()[0]
sisl/_core/tests/test_geometry.py:        # Even if the geometry has nsc > 1, if we set periodic=False
sisl/io/dftb/realdat.py:            if np.any(nsc > 1):
sisl/io/siesta/binaries.py:            if all(nsc > 1):
sisl/io/siesta/fdf.py:        # periodic = geom.nsc > 1
sisl/io/siesta/tests/test_orb_indx.py:    assert np.all(nsc > 1)
sisl/physics/brillouinzone.py:           The default value is `(self.parent.nsc > 1).nonzero()[0]`.
sisl/physics/brillouinzone.py:            periodic = (self.parent.nsc > 1).nonzero()[0]
sisl/physics/brillouinzone.py:            if self.points.shape[1] != np.sum(self.parent.nsc > 1):
sisl/viz/data/pdos.py:            kgrid = [3 if nsc > 1 else 1 for nsc in H.geometry.nsc]

~/codes/sisl/src % grep "nsc == 1" **/*.py                                                                                                                                               main
sisl/_core/geometry.py:        if all(self.nsc == 1):
sisl/_core/sparse_geometry.py:        # since we may have nsc == 1 and cut it X times.
sisl/_core/sparse_geometry.py:        Untiling structures with ``nsc == 1`` along `axis` are assumed to have periodic boundary
sisl/_core/sparse_geometry.py:        When untiling structures with ``nsc == 1`` along `axis` it is important to
sisl/_core/sparse_geometry.py:        Untiling structures with ``nsc == 1`` along `axis` are assumed to have periodic boundary
sisl/_core/sparse_geometry.py:        When untiling structures with ``nsc == 1`` along `axis` it is important to
sisl/io/siesta/binaries.py:                # we will never have all(nsc == 1) since that is
sisl/io/siesta/tests/test_orb_indx.py:    assert np.all(nsc == 1)
sisl/io/xsf.py:        if all(lattice.nsc == 1):

zerothi avatar Apr 26 '24 19:04 zerothi

This goes back to the never ending discussion :smile:

My view is that as long as you have periodicity, it makes sense to translate to the unit cell regardless of nsc.

pfebrer avatar Apr 26 '24 19:04 pfebrer

Ok, lets do that then :)

zerothi avatar Apr 26 '24 19:04 zerothi

Even more so because nsc is many times [1,1,1] because it is simply unset, but we know that there is periodicity. For example when a geometry is read from a SIESTA file.

pfebrer avatar Apr 26 '24 19:04 pfebrer

Even more so because nsc is many times [1,1,1] because it is simply unset, but we know that there is periodicity. For example when a geometry is read from a SIESTA file.

But... ;) When PSolver can be used, then we will not have periodicity. And the all hell breaks loose. ;) Half-joke aside. Do we know if all geometries read from Siesta actually have periodicity along all directions?

zerothi avatar Apr 26 '24 19:04 zerothi

For the moment they should, right? SIESTA assumes that everything is periodic when it calculates things.

But yeah when the PSolver makes it possible to not treat things periodically I can see that this will become more complicated :sweat_smile: Maybe one could check Psolver options then, I don't know.

But that is a problem of how to determine boundary conditions. I think that once you have established that the boundaries are periodic I believe it makes sense to use that fact here.

pfebrer avatar Apr 26 '24 20:04 pfebrer