Change index type names

Bug #1090272 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
Critical
Garth Wells

Bug Description

Before next release, need to change

  sizet -> size_t

in Python interface, and

   DolfinIndex -> dolfin::index

Changed in dolfin:
importance: Undecided → Critical
Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 1090272] [NEW] Change index type names

If you have not started on the SWIG side I can take responsibility of that.

Johan

On 12/14/2012 10:11 AM, Garth Wells wrote:
> Public bug reported:
>
> Before next release, need to change
>
> sizet -> size_t
>
> in Python interface, and
>
> DolfinIndex -> dolfin::index
>
> ** Affects: dolfin
> Importance: Critical
> Status: New
>
> ** Changed in: dolfin
> Importance: Undecided => Critical
>

Revision history for this message
Garth Wells (garth-wells) wrote :

On Fri, Dec 14, 2012 at 10:46 AM, Johan Hake <email address hidden> wrote:
> If you have not started on the SWIG side I can take responsibility of
> that.
>

I haven't started, so go for it.

Garth

> Johan
>
> On 12/14/2012 10:11 AM, Garth Wells wrote:
>> Public bug reported:
>>
>> Before next release, need to change
>>
>> sizet -> size_t
>>
>> in Python interface, and
>>
>> DolfinIndex -> dolfin::index
>>
>> ** Affects: dolfin
>> Importance: Critical
>> Status: New
>>
>> ** Changed in: dolfin
>> Importance: Undecided => Critical
>>
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/1090272
>
> Title:
> Change index type names
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/1090272/+subscriptions

Revision history for this message
Johan Hake (johan-hake) wrote :

Ok, I am on to it.

Johan

On 12/14/2012 11:57 AM, Garth Wells wrote:
> On Fri, Dec 14, 2012 at 10:46 AM, Johan Hake <email address hidden> wrote:
>> If you have not started on the SWIG side I can take responsibility of
>> that.
>>
>
> I haven't started, so go for it.
>
> Garth
>
>> Johan
>>
>> On 12/14/2012 10:11 AM, Garth Wells wrote:
>>> Public bug reported:
>>>
>>> Before next release, need to change
>>>
>>> sizet -> size_t
>>>
>>> in Python interface, and
>>>
>>> DolfinIndex -> dolfin::index
>>>
>>> ** Affects: dolfin
>>> Importance: Critical
>>> Status: New
>>>
>>> ** Changed in: dolfin
>>> Importance: Undecided => Critical
>>>
>>
>> --
>> You received this bug notification because you are a member of DOLFIN
>> Core Team, which is subscribed to DOLFIN.
>> https://bugs.launchpad.net/bugs/1090272
>>
>> Title:
>> Change index type names
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/dolfin/+bug/1090272/+subscriptions
>

Revision history for this message
Johan Hake (johan-hake) wrote :

Done my part

Changed in dolfin:
status: New → In Progress
assignee: nobody → Garth Wells (garth-wells)
milestone: none → 1.1.0
Revision history for this message
Anders Logg (logg) wrote :

When this is done and the buildbot runs fine with size_t, should we
also add back "uint" as an alias for "size_t" in the Python interface?

--
Anders

On Fri, Dec 14, 2012 at 09:11:23AM -0000, Garth Wells wrote:
> Public bug reported:
>
> Before next release, need to change
>
> sizet -> size_t
>
> in Python interface, and
>
> DolfinIndex -> dolfin::index
>
> ** Affects: dolfin
> Importance: Critical
> Status: New
>
> ** Changed in: dolfin
> Importance: Undecided => Critical
>

Revision history for this message
Garth Wells (garth-wells) wrote :

On Wed, Dec 19, 2012 at 4:22 PM, Anders Logg <email address hidden> wrote:
> When this is done and the buildbot runs fine with size_t, should we
> also add back "uint" as an alias for "size_t" in the Python interface?
>

It will be removed eventually, so I'm thinking better removed sooner
rather than later.

Garth

> --
> Anders
>
>
> On Fri, Dec 14, 2012 at 09:11:23AM -0000, Garth Wells wrote:
>> Public bug reported:
>>
>> Before next release, need to change
>>
>> sizet -> size_t
>>
>> in Python interface, and
>>
>> DolfinIndex -> dolfin::index
>>
>> ** Affects: dolfin
>> Importance: Critical
>> Status: New
>>
>> ** Changed in: dolfin
>> Importance: Undecided => Critical
>>
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/1090272
>
> Title:
> Change index type names
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/1090272/+subscriptions

Revision history for this message
Anders Logg (logg) wrote :

On Wed, Dec 19, 2012 at 04:35:14PM -0000, Garth Wells wrote:
> On Wed, Dec 19, 2012 at 4:22 PM, Anders Logg <email address hidden> wrote:
> > When this is done and the buildbot runs fine with size_t, should we
> > also add back "uint" as an alias for "size_t" in the Python interface?
> >
>
> It will be removed eventually, so I'm thinking better removed sooner
> rather than later.

Maybe, considering "uint" is just as cryptic as "size_t". Could we do
something else to simplify the creation of size_t-valued
MeshFunctions? 99% of all cases where a MeshFunction is used it will
be size_t-valued.

One suggestion would be this:

  f = MeshFunction(mesh, dim=3, type="double")
  f = FacetFunction(mesh, type="double")
  f = FacetFunction(mesh) # type defaults to size_t

--
Anders

Revision history for this message
Garth Wells (garth-wells) wrote :

Changed dolfin::DolfinIndex - > dolfin::la_index

dolfin::index seemed to common, especially since we use

   using namespace dolfin;

in (almost) all .cpp files.

Changed in dolfin:
status: In Progress → Fix Committed
Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 1090272] Re: Change index type names

Yes, la_index is better.

--
Anders

On Wed, Dec 19, 2012 at 07:12:14PM -0000, Garth Wells wrote:
> Changed dolfin::DolfinIndex - > dolfin::la_index
>
> dolfin::index seemed to common, especially since we use
>
> using namespace dolfin;
>
> in (almost) all .cpp files.
>
> ** Changed in: dolfin
> Status: In Progress => Fix Committed
>

Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 1090272] [NEW] Change index type names

On 12/19/2012 06:26 PM, Anders Logg wrote:
> On Wed, Dec 19, 2012 at 04:35:14PM -0000, Garth Wells wrote:
>> On Wed, Dec 19, 2012 at 4:22 PM, Anders Logg <email address hidden> wrote:
>>> When this is done and the buildbot runs fine with size_t, should we
>>> also add back "uint" as an alias for "size_t" in the Python interface?
>>>
>>
>> It will be removed eventually, so I'm thinking better removed sooner
>> rather than later.
>
> Maybe, considering "uint" is just as cryptic as "size_t". Could we do
> something else to simplify the creation of size_t-valued
> MeshFunctions? 99% of all cases where a MeshFunction is used it will
> be size_t-valued.
>
> One suggestion would be this:
>
> f = MeshFunction(mesh, dim=3, type="double")
> f = FacetFunction(mesh, type="double")
> f = FacetFunction(mesh) # type defaults to size_t

I tend to agree, but it is not that important to me. It could be more
confusing for users to remove it than keeping it.

johan

Revision history for this message
Garth Wells (garth-wells) wrote :

On Thu, Dec 20, 2012 at 7:15 AM, Johan Hake <email address hidden> wrote:
> On 12/19/2012 06:26 PM, Anders Logg wrote:
>> On Wed, Dec 19, 2012 at 04:35:14PM -0000, Garth Wells wrote:
>>> On Wed, Dec 19, 2012 at 4:22 PM, Anders Logg <email address hidden> wrote:
>>>> When this is done and the buildbot runs fine with size_t, should we
>>>> also add back "uint" as an alias for "size_t" in the Python interface?
>>>>
>>>
>>> It will be removed eventually, so I'm thinking better removed sooner
>>> rather than later.
>>
>> Maybe, considering "uint" is just as cryptic as "size_t". Could we do
>> something else to simplify the creation of size_t-valued
>> MeshFunctions? 99% of all cases where a MeshFunction is used it will
>> be size_t-valued.
>>
>> One suggestion would be this:
>>
>> f = MeshFunction(mesh, dim=3, type="double")
>> f = FacetFunction(mesh, type="double")
>> f = FacetFunction(mesh) # type defaults to size_t
>
> I tend to agree, but it is not that important to me. It could be more
> confusing for users to remove it than keeping it.
>

I'm not so keen on default arguments - it starts out ok, but we have
examples (especially in the assemblers) where it can get completely
out of hand over time.

Garth

> johan
>
> --
> You received this bug notification because you are a member of DOLFIN
> Core Team, which is subscribed to DOLFIN.
> https://bugs.launchpad.net/bugs/1090272
>
> Title:
> Change index type names
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dolfin/+bug/1090272/+subscriptions

Changed in dolfin:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.