Skip to content

Commit

Permalink
Include applicative exact aspects in immediate aspects function
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoventura committed May 17, 2016
1 parent 8e85f6d commit ed7222d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions flatlib/tools/chartdynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,25 @@ def aspectsByCat(self, ID, aspList):
})

return res

def immediateAspects(self, ID, aspList):
""" Returns the last separation and next application
considering a list of possible aspects.
"""
asps = self.aspectsByCat(ID, aspList)

# Get application and separations sorted by orb
applications = sorted(asps[const.APPLICATIVE],
key=lambda var: var['orb'])
separations = sorted(asps[const.SEPARATIVE],
key=lambda var: var['orb'])


applications = asps[const.APPLICATIVE]
separations = asps[const.SEPARATIVE]
exact = asps[const.EXACT]

# Get applications and separations sorted by orb

applications = applications + [val for val in exact if val['orb'] >= 0]

applications = sorted(applications, key=lambda var: var['orb'])
separations = sorted(separations, key=lambda var: var['orb'])

return (
separations[0] if separations else None,
applications[0] if applications else None
Expand All @@ -144,4 +149,4 @@ def isVOC(self, ID):
asps = self.aspectsByCat(ID, const.MAJOR_ASPECTS)
applications = asps[const.APPLICATIVE]
exacts = asps[const.EXACT]
return len(applications) == 0 and len(exacts) == 0
return len(applications) == 0 and len(exacts) == 0

0 comments on commit ed7222d

Please sign in to comment.