Skip to content

Commit

Permalink
Taxonomy 09-20-19 Update (#179)
Browse files Browse the repository at this point in the history
* Taxonomy 09-20-19 Update
  • Loading branch information
shelcrow authored Nov 8, 2019
1 parent 873e4a9 commit 0a55ddd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ docs/build/
build/
dist/
*.egg-info/

.pytest_cache
Binary file modified dist-cli/Linux/ob
Binary file not shown.
Binary file modified dist-cli/Mac/ob
Binary file not shown.
Binary file modified dist-cli/Windows/ob.exe
100755 → 100644
Binary file not shown.
16 changes: 8 additions & 8 deletions oblib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

XML_NS = {"xbrldi:": "{http://xbrl.org/2006/xbrldi}",
"link:": "{http://www.xbrl.org/2003/linkbase}",
"solar:": "{http://xbrl.us/Solar/2019-07-31/solar}",
"solar:": "{http://xbrl.us/Solar/2019-09-20/solar}",
"dei:": "{http://xbrl.sec.gov/dei/2014-01-31}",
"us-gaap:": "{http://fasb.org/us-gaap/2017-01-31}"}

Expand All @@ -46,9 +46,9 @@

GAAP_NS = "{http://fasb.org/us-gaap/2017-01-31}"

SOLAR_NS = "{http://xbrl.us/Solar/2019-07-31/solar}"
SOLAR_NS = "{http://xbrl.us/Solar/2019-09-20/solar}"

TAXONOMY_ALL_FILENAME = "solar_all_2019-07-31_def.xml"
TAXONOMY_ALL_FILENAME = "solar_all_2019-09-20_def.xml"

ROLE_DOCUMENTATION = "http://www.xbrl.org/2003/role/documentation"

Expand All @@ -63,17 +63,17 @@
"xmlns:xsi": "http://www.w3.org/2001/XMRLSchema-instance",
"xmlns:units": "http://www.xbrl.org/2009/utr",
"xmlns:xbrldi": "http://xbrl.org/2006/xbrldi",
"xmlns:solar": "http://xbrl.us/Solar/2019-07-31/solar"
"xmlns:solar": "http://xbrl.us/Solar/2019-09-20/solar"
}

TAXONOMY_NAME = "https://raw.githubusercontent.com/SunSpecOrangeButton/solar-taxonomy/master/core/solar_all_2019-07-31.xsd"
TAXONOMY_NAME = "https://raw.githubusercontent.com/SunSpecOrangeButton/solar-taxonomy/master/core/solar_all_2019-09-20.xsd"

DEI_XSD = "dei-2018-01-31.xsd"

US_GAAP_XSD = "us-gaap-2017-01-31.xsd"

SOLAR_XSD = "solar_2019-07-31.xsd"
SOLAR_XSD = "solar_2019-09-20.xsd"

SOLAR_ALL_PRE_XML = "solar_all_2019-07-31_pre.xml"
SOLAR_ALL_PRE_XML = "solar_all_2019-09-20_pre.xml"

SOLAR_LAB_XML = "solar_2019-07-31_lab.xml"
SOLAR_LAB_XML = "solar_2019-09-20_lab.xml"
10 changes: 5 additions & 5 deletions oblib/tests/test_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ def test_conversion_to_xml(self):
'solar:TestConditionAxis'])
for axis in axes:
if axis.attrib["dimension"] == 'solar:ProductIdentifierAxis':
self.assertEqual(axis.getchildren()[0].tag, "{http://xbrl.us/Solar/2019-07-31/solar}ProductIdentifierDomain")
self.assertEqual(axis.getchildren()[0].tag, "{http://xbrl.us/Solar/2019-09-20/solar}ProductIdentifierDomain")
self.assertEqual(axis.getchildren()[0].text, "placeholder")
elif axis.attrib["dimension"] == 'solar:TestConditionsAxis':
self.assertEqual(axis.getchildren()[0].tag, "{http://xbrl.us/Solar/2019-07-31/solar}TestConditionDomain")
self.assertEqual(axis.getchildren()[0].tag, "{http://xbrl.us/Solar/2019-09-20/solar}TestConditionDomain")
self.assertEqual(axis.getchildren()[0].text, "solar:StandardTestConditionMember")

# one should have period containing <forever/> other should have period containing <instant> containing today's date.
Expand All @@ -383,8 +383,8 @@ def test_conversion_to_xml(self):

# Expect to see two facts solar:DeviceCost and solar:TypeOfDevice,
# each containing text of the fact value
costFact = root.find('{http://xbrl.us/Solar/2019-07-31/solar}DeviceCost')
typeFact = root.find('{http://xbrl.us/Solar/2019-07-31/solar}TypeOfDevice')
costFact = root.find('{http://xbrl.us/Solar/2019-09-20/solar}DeviceCost')
typeFact = root.find('{http://xbrl.us/Solar/2019-09-20/solar}TypeOfDevice')
self.assertEqual(costFact.text, "100")
self.assertEqual(typeFact.text, "ModuleMember")
# They should have contextRef and (in the case of cost) unitRef attributes:
Expand Down Expand Up @@ -842,7 +842,7 @@ def test_ids_in_xml_and_json(self):
# Look for fact ID in XML:
xml = doc.to_XML_string()
root = etree.fromstring(xml)
fact = root.find("{http://xbrl.us/Solar/2019-07-31/solar}ModuleNameplateCapacity")
fact = root.find("{http://xbrl.us/Solar/2019-09-20/solar}ModuleNameplateCapacity")
self.assertEqual(fact.attrib["id"], fact_id)

def test_input_ids(self):
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

mkdir oblib/data
cd oblib/data
git clone --branch 2019-07-31 https://github.com/SunSpecOrangeButton/solar-taxonomy.git
git clone --branch 2019-09-20 https://github.com/SunSpecOrangeButton/solar-taxonomy.git
cd solar-taxonomy
rm SolarTaxonomyMaster.xlsx
mkdir external
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

setup(
name='oblib',
version='1.1.0',
version='1.1.1',
description='Orange Button Python Library',
long_description=
"""
Expand Down

0 comments on commit 0a55ddd

Please sign in to comment.