COSIMA / esmgrids

Python representation of Earth System Model grids.
Apache License 2.0
4 stars 7 forks source link

Improved setup and ci #7

Closed micaeljtoliveira closed 5 months ago

micaeljtoliveira commented 5 months ago

First steps in modernizing the infrastructure.

micaeljtoliveira commented 5 months ago

@dougiesquire What else needs to be added? Conda?

micaeljtoliveira commented 5 months ago

Note that tests are currently failing, as it tries to download data that does not seem to be available anymore.

anton-seaice commented 5 months ago

I think if we make a main branch this should run yes ?

anton-seaice commented 5 months ago

@dougiesquire What else needs to be added? Conda?

It looks like all the code here is python, so I would suggest we try just adding pip dependencies until everything works?

Edit: and make a new issue to add black linting and flake if we think that is useful?

micaeljtoliveira commented 5 months ago

I think if we make a main branch this should run yes ?

Yes, the pipeline will run, but the tests will fail. I was thinking on getting tests to run correctly first before renaming master, but I guess we can do it now.

Edit: and make a new issue to add black linting and flake if we think that is useful?

I've already started working on that, but on a different branch, to keep things tidy ;)

micaeljtoliveira commented 5 months ago

Comment by @anton-seaice in #8:

I tried to move the existing tests over the github actions, and found many failures.

Most of them seem to be about imports, but some are undefined names that are not clear at all where they have come from!

e.g.


./build/lib/esmgrids/fv300_grid.py:26:32: F821 undefined name 'sys'
                          file=sys.stderr)
                               ^
./build/lib/esmgrids/oras_grid.py:36:47: F821 undefined name 'zdescription'
                                       levels=zdescription)
                                              ^
./build/lib/esmgrids/um_grid.py:20:34: F821 undefined name 'os'
        self.um_restart_output = os.path.join(output_dir,
                                 ^
./build/lib/esmgrids/um_grid.py:21:47: F821 undefined name 'os'
                                              os.path.basename(um_restart))
                                              ^
./build/lib/esmgrids/um_grid.py:22:34: F821 undefined name 'os'
        self.lfrac_filename_nc = os.path.join(output_dir, 'lfrac.nc')
                                 ^
...

Yes, I can confirm this. It looks like there are files missing or something like that. If we want to activate flake8 checks, we have to either fix this or tell flake to ignore this kind of errors. IMO, the later option seems like the only sensible option at this time.