Subject: [FFC-dev] A bug when jit() is called without any options

From: Johan Hake <[email-masked]>
Date: Fri, 12 Sep 2008 08:20:27 +0200

Hello!

When jit is called without any options I get the following:

  File "/home/hake/local/lib/python2.5/site-packages/ffc/jit/jit.py", line 43, 
in jit
    options = check_options(form, options)
  File "/home/hake/local/lib/python2.5/site-packages/ffc/jit/jit.py", line 80, 
in check_options
    options = options.copy()
AttributeError: 'NoneType' object has no attribute 'copy'

jit tries to copy a None. 

    if options is None:
        options = {}
    else:
        options = options.copy()

Would du the trick.

Johan

---

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 12 Sep 2008 11:06:13 +0200

Maybe rather

if options is None:
    options = DEFAULT_FFC_OPTIONS.copy() # whatever the name is
else:
    options = options.copy()

-- 
Martin

2008/9/12 Johan Hake <[email-masked]>:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev
>

---

From: Anders Logg <[email-masked]>
Date: Fri, 12 Sep 2008 11:52:45 +0200

>     options = DEFAULT_FFC_OPTIONS.copy() # whatever the name is

This is handled anyway later, so it's enough to have an empty
dictionary:

  # Add defaults for missing options                                                                                       
  for key in FFC_OPTIONS_JIT:
      if not key in options:
          options[key] = FFC_OPTIONS_JIT[key]

-- 
Anders