Possibly, but this deprecation warning will tell users to change their code. But since dolfin has been updated, maybe their code is already broken if they use this? Then I can just remove it. At least I got to use Python properties again, haven't done that in a while :)
Martin On 22 June 2011 19:28, Anders Logg <l...@simula.no> wrote: > I thought this was already fixed in DOLFIN. > > -- > Anders > > > ---------- Forwarded message ---------- > From: nore...@launchpad.net > To: Anders Logg <l...@simula.no> > Date: Wed, 22 Jun 2011 17:14:18 -0000 > Subject: [Branch ~ufl-core/ufl/main] Rev 1145: Made Form.*_domains into > properties which emit > ------------------------------------------------------------ > revno: 1145 > committer: Martin Alnes <marti...@simula.no> > branch nick: work > timestamp: Wed 2011-06-22 19:10:37 +0200 > message: > Made Form.*_domains into properties which emit > a deprecation warning when they are set. > > We should get all pydolfin code over to use > the dx[boundaries] syntax before 1.0 to avoid > the bugs Form.*_domains make possible. > > Also did some docstring updates > modified: > ufl/form.py > > > -- > lp:ufl > https://code.launchpad.net/~ufl-core/ufl/main > > Your team UFL Core Team is subscribed to branch lp:ufl. > To unsubscribe from this branch go to > https://code.launchpad.net/~ufl-core/ufl/main/+edit-subscription > > === modified file 'ufl/form.py' > --- ufl/form.py 2011-06-21 12:44:19 +0000 > +++ ufl/form.py 2011-06-22 17:10:37 +0000 > @@ -34,27 +34,49 @@ > class Form(object): > """Description of a weak form consisting of a sum of integrals over > subdomains.""" > __slots__ = ("_integrals", > - "_repr", "_hash", "_str", "_form_data", "_is_preprocessed", > - "cell_domains", "exterior_facet_domains", > "interior_facet_domains") > - > - # Note: cell_domains, exterior_facet_domains and interior_facet_domains > - # are used by DOLFIN to pass data to the assembler. They can otherwise > - # safely be ignored. > + "_repr", "_hash", "_str", > + "_form_data", "_is_preprocessed", > + "_cell_domains", "_exterior_facet_domains", > "_interior_facet_domains") > > def __init__(self, integrals): > self._integrals = tuple(integrals) > - ufl_assert(all(isinstance(itg, Integral) for itg in integrals), > "Expecting list of integrals.") > + ufl_assert(all(isinstance(itg, Integral) for itg in integrals), > + "Expecting list of integrals.") > self._str = None > self._repr = None > self._hash = None > self._form_data = None > self._is_preprocessed = False > > - # TODO: Can we attach non-ufl payloads in a more generic fashion? > - # This seems prone to change with dolfin versions. > - self.cell_domains = None > - self.exterior_facet_domains = None > - self.interior_facet_domains = None > + # Note: cell_domains, exterior_facet_domains and > interior_facet_domains > + # are used by DOLFIN to pass data to the assembler. They are > deprecated > + # because they lead to bugs and will be removed. > + self._cell_domains = None > + self._exterior_facet_domains = None > + self._interior_facet_domains = None > + > + # TODO: Remove these completely! > + @property > + def cell_domains(self): > + return self._cell_domains > + @cell_domains.setter > + def _set_cell_domains(self, domains): > + warning("Deprecation warning! Attach your boundary indicators to the > measure instead.") > + self._cell_domains = domains > + @property > + def exterior_facet_domains(self): > + return self._exterior_facet_domains > + @exterior_facet_domains.setter > + def _set_exterior_facet_domains(self, domains): > + warning("Deprecation warning! Attach your boundary indicators to the > measure instead.") > + self._exterior_facet_domains = domains > + @property > + def interior_facet_domains(self): > + return self._interior_facet_domains > + @interior_facet_domains.setter > + def _set_interior_facet_domains(self, domains): > + warning("Deprecation warning! Attach your boundary indicators to the > measure instead.") > + self._interior_facet_domains = domains > > def cell(self): > c = None > @@ -168,19 +190,25 @@ > return Form(newintegrals) > > def __sub__(self, other): > + "Subtract other form from this one." > return self + (-other) > > def __neg__(self): > - # This enables the handy "-form" syntax for e.g. the linearized > system (J, -F) from a nonlinear form F > + """Negate all integrals in form. > + > + This enables the handy "-form" syntax for e.g. the > + linearized system (J, -F) from a nonlinear form F.""" > return Form([-itg for itg in self._integrals]) > > def __rmul__(self, scalar): > + "Multiply all integrals in form with constant scalar value." > # This enables the handy "0*form" syntax > - ufl_assert(is_python_scalar(scalar), "Only multiplication by scalar > literals currently supported.") > + ufl_assert(is_python_scalar(scalar), > + "Only multiplication by scalar expressions currently > supported.") > return Form([scalar*itg for itg in self._integrals]) > > def __mul__(self, coefficient): > - "The action of this form on the given coefficient." > + "UFL form operator: Take the action of this form on the given > coefficient." > from ufl.formoperators import action > return action(self, coefficient) > > > > _______________________________________________ > Mailing list: https://launchpad.net/~ufl > Post to : u...@lists.launchpad.net > Unsubscribe : https://launchpad.net/~ufl > More help : https://help.launchpad.net/ListHelp > > _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp