Skip to content

make unit handling dependencies optional #2

Open
@mcgibbon

Description

@mcgibbon

The dependency of atmos on cfunits can be removed by checking whether cfunits can be imported, and if it cannot, disabling unit handling functionality.

This would entail, in solve.py:

  • putting the cfunits import in a try: except ImportError block
  • raising an exception whenever a _units parameter is given when cfunits is not available, which indicates that cfunits is required for unit handling
  • only executing lines that call cfunits when cfunits is available

And also:

  • modifying the tests module so that unit-dependent tests don't execute if cfunits is not installed

The purpose of this is to make installation easier for users that don't have udunits installed on their system to install atmos. But am I right in thinking that cfunits depends on having a system-installed udunits library available? And is there another package on pypi that would install udunits in some sort of wrapper, without needing a system installation of udunits?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions