Mercurial > hg > horiscopes
changeset 28:5825520de143
fixing some existing bugs
author | DaveM |
---|---|
date | Mon, 30 Apr 2018 18:13:40 +0100 |
parents | a94569c4a70b |
children | 52ea10196da3 |
files | V5/compatibilityRules.csv V5/runme.py V5/synastry.py timesheet.xlsx |
diffstat | 4 files changed, 40 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/V5/compatibilityRules.csv Mon Apr 30 15:13:04 2018 +0100 +++ b/V5/compatibilityRules.csv Mon Apr 30 18:13:40 2018 +0100 @@ -45,7 +45,8 @@ Asc,Conjunction semi-Square Square Opposition,sun/moon,3 Asc,,7th house,3 Vertex,Conjunction semi-Square Square Opposition,sun/moon,3 -Node,Conjunction,IC/MC,3 +Node,Conjunction,IC,3 +Node,Conjunction,mc,3 Sun,Opposition,Sun,2 Sun,Opposition,Moon,2 Sun,Conjunction,Mercury,2
--- a/V5/runme.py Mon Apr 30 15:13:04 2018 +0100 +++ b/V5/runme.py Mon Apr 30 18:13:40 2018 +0100 @@ -111,7 +111,7 @@ person.horiscope = person.parsePage() # person.horiscope.printPositions() if saveFile is not None: - savePick('raw_'+saveFile,rawData) + # savePick('raw_'+saveFile,rawData) savePick(saveFile,people) def parseHoriscopeRaw(people,saveFile): @@ -135,8 +135,8 @@ def _main(): # os.remove('outData.pick') # os.remove('fullResults.pick') - os.remove('outData_collect.pick') - os.remove('raw_outData_collect.pick') + # os.remove('outData_collect.pick') + # os.remove('raw_outData_collect.pick') pickFile = 'outData.pick' if not os.path.exists(pickFile): people = makePeople('individuals.csv')
--- a/V5/synastry.py Mon Apr 30 15:13:04 2018 +0100 +++ b/V5/synastry.py Mon Apr 30 18:13:40 2018 +0100 @@ -13,7 +13,7 @@ def __init__(self): self.rules = [] self.uniqueID = 0 - print 'Warning, need to fix [Vertex, Ascendant House, IC/MC and None Location] issues' + print 'Warning, need to fix [Vertex and None Location] issues\n the semi-square has a 2 degrees orbs. For planets/axis in aspects with Mid-Point a maximum of 2 degrees orb applies. Same for the Vertex' def addRule(self,planetTuple,aspectList,score): rule = compatibilityRule(self.uniqueID,planetTuple,aspectList,score) @@ -63,44 +63,48 @@ def calcCompatibility(self, horiscope): score = 0 - for r in sorted(self.rules): - if 'vertex' in r.planet: + for rule in sorted(self.rules): + if 'vertex' in rule.planet: # print 'ERROR - catch Vertex issue' pass - elif 'southnode' in r.planet: - # print 'ERROR - catch South Node issue' - pass - elif 'ic/mc' in r.planet: - # print 'ERROR - catch IC/MC issue' - pass - elif r.planet[1] == 'house' and r.planet[0] == 'asc': + # elif 'southnode' in rule.planet: + # pdb.set_trace() + # # print 'ERROR - catch South Node issue' + # pass + elif rule.planet[1] == 'house' and rule.planet[0] == 'asc': # print 'ERROR - catch Ascendant House issue' - pass - elif horiscope.planets[r.planet[0]].angleA is None: + angle = horiscope.calcAngle('asc','asc') + if (angle > 210 and angle < 240) or (angle > 120 and angle < 150): + score += rule.score + print rule.planet[0] +' '+ rule.planet[1] +' '+ str(aspect)+' '+str(rule.score) + # aspect,variance = horiscope.calcAspect(rule.planet[order],rule.planet[not order]) + + elif horiscope.planets[rule.planet[0]].angleA is None: + pdb.set_trace() # print 'Error - None Location' return None - elif r.planet[1] == 'house': - if horiscope.isInHouse(r.planet[0],r.aspect): - score += r.score - print r.planet[0] +' '+ r.planet[1] +' '+ str(aspect)+' '+str(r.score) - elif r.planet[0] == r.planet[1]: - aspect,variance = horiscope.calcAspect(r.planet[0],r.planet[1]) + elif rule.planet[1] == 'house': + if horiscope.isInHouse(rule.planet[0],rule.aspect): + score += rule.score + print rule.planet[0] +' '+ rule.planet[1] +' '+ str(aspect)+' '+str(rule.score) + elif rule.planet[0] == rule.planet[1]: + aspect,variance = horiscope.calcAspect(rule.planet[0],rule.planet[1]) if aspect is not None: - if aspect in r.aspect: - score += r.score - print r.planet[0]+' '+aspect +' '+ r.planet[1] +' '+ str(r.score) + if aspect in rule.aspect: + score += rule.score + print rule.planet[0]+' '+aspect +' '+ rule.planet[1] +' '+ str(rule.score) else: for order in [0,1]: - aspect,variance = horiscope.calcAspect(r.planet[order],r.planet[not order]) + aspect,variance = horiscope.calcAspect(rule.planet[order],rule.planet[not order]) if aspect is not None: # print aspect # currentR = r # pdb.set_trace() - if aspect in r.aspect: - score += r.score - print r.planet[0] +' '+ aspect +' '+ r.planet[1] +' '+ str(r.score) + if aspect in rule.aspect: + score += rule.score + print rule.planet[0] +' '+ aspect +' '+ rule.planet[1] +' '+ str(rule.score) else: - print r.planet[0] +' '+ aspect +' '+ r.planet[1] +' 0' + print rule.planet[0] +' '+ aspect +' '+ rule.planet[1] +' 0' print score return score @@ -217,7 +221,7 @@ def requestURL(self): # self.resp = requests.get(self.url, params=self.payload) - self.resp = lr.get(self.url, params=self.payload, timeout=5) + self.resp = lr.get(self.url, params=self.payload, timeout=5, source='local', verbose=True) # time.sleep(5) return self.resp @@ -247,8 +251,8 @@ self.horiscope.planets[planetName].setLocation(divList[i+2].getText(),divList[i+1].img.attrs['alt'],0) self.horiscope.planets[planetName].setLocation(divList[i+4].getText(),divList[i+3].img.attrs['alt'],1) if planetName == 'node': - self.horiscope.planets['sNode'].angleA = self.horiscope.planets['node'].angleA+180 - self.horiscope.planets['sNode'].angleB = self.horiscope.planets['node'].angleB+180 + self.horiscope.planets['southnode'].angleA = self.horiscope.planets['node'].angleA+180 + self.horiscope.planets['southnode'].angleB = self.horiscope.planets['node'].angleB+180 return self.horiscope @@ -288,7 +292,7 @@ aspectRange = {'conjunction':10,'semi-square':2,'sextile':4,'square':10,'trine':10,'opposition':10} # zodiacAngle = {'aries':0,'taurus':30,'gemini':60,'cancer':90,'leo':120,'virgo':150,'libra':180,'scorpio':210,'sagittarius':240,'capricorn':270,'aquarius':300,'pisces':330} # Taken from https://en.wikipedia.org/wiki/Astrological_sign, with reference from https://en.wikipedia.org/wiki/Astrological_symbols#Signs_of_the_zodiac - planetNames = ['sun','moon','mercury','venus','mars','jupiter','saturn','uranus','neptune','pluto','node','sNode','lilith','chiron','asc','ic','dsc','mc','asc/mc','sun/moon'] + planetNames = ['sun','moon','mercury','venus','mars','jupiter','saturn','uranus','neptune','pluto','node','southnode','lilith','chiron','asc','ic','dsc','mc','asc/mc','sun/moon'] def __init__(self): self.planets = {} for p in planetPositions.planetNames: @@ -308,7 +312,7 @@ if self.angle-self.aspectRange[aspect] < self.aspectDict[aspect] and self.angle+self.aspectRange[aspect] > self.aspectDict[aspect]: aspectDiff = round(abs(self.angle - planetPositions.aspectDict[aspect]),2) self.aspect[componentA,componentB] = (aspect,aspectDiff) - print componentA,self.planets[componentA].angleA,componentB,self.planets[componentB].angleB,self.angle,aspect,aspectDiff + # print componentA,self.planets[componentA].angleA,componentB,self.planets[componentB].angleB,self.angle,aspect,aspectDiff return aspect,aspectDiff return None,None