Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 78 - decimals/precision #111

Merged
merged 60 commits into from
Feb 7, 2019

Conversation

jonoxia
Copy link
Collaborator

@jonoxia jonoxia commented Jan 26, 2019

OBInstance.set() now accepts either a "decimals" or "precision" argument (but not both), and it is stored in the Fact and written out to XML or JSON. This solves issue #78 .

…rom _def.xml. Created a first data model class named Entrypoint representing an instance of a document corresponding to a particular entry point. Constructor uses arcrole relationships to deduce what tables belong in the document. Added unit test for this class.
…k up which table a given concept belongs to, and to distinguish abstract concepts (lineItems, Abstracts, Domains, etc) from actually-writeable concepts.
… EntryPoint which identifies whether or not sufficient context is provided to write a fact for a named concept. Checks for appropriate time duration/instant so far. Next step is to check the required table axes are present as well.
…cks that the required table axes are present in the given context.
…o the new locations required by the directory restructure
… instance as an argument to constructor, instead of creating its own
…axonomy() in taxonomy.py that you can call instead of instantiating.
…ither a 'context' keyword arg providing a Context object, or else separate instant/duration/entity/axes keyword args which are together used to create a Context object.
…cts keyed first by table name, then by context ID, then by concept. Hypercube class handles de-duping contexts so that two contexts with the same data fields will be combined into one.
…ds to export an EntryPoint instance to XML or JSON string or file
…s. A table now knows which axes use domains and which do not, and for domain axes it can reject a context that tries to provide an out-of-domain value for that axis.
…Button#53 - Now checking that the units provided in EntryPoint.set() exist in the taxonomy and match the expected data type of the concept you are trying to set. It will reject an attempt to .set() a concept without a matching unit, for example if you try to set a monetary data type without providing a currency unit. In XML export, a unit tag is written out for facts tags to reference.
…datatype the concept expects, for basic typed concepcts. Reject attempt to set an invalid datatype.
…ontext() and values given there are used to replace any values not given by the context in .set().
…In datatype validation, allow unicode strings, support more date formats, support (by stripping them out) dollar signs and commas in money types.
…facts are a dictionary (with UUIDs for keys) rather than a list, aspect keys are not xbrl: prefixed, and period is either a single date or two dates joined by a / character.
… decimals argument, and it is written out to XML or JSON
@cla-bot cla-bot bot added the cla-signed label Jan 26, 2019
@codecov-io
Copy link

codecov-io commented Jan 26, 2019

Codecov Report

Merging #111 into master will increase coverage by 0.65%.
The diff coverage is 97.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   88.63%   89.29%   +0.65%     
==========================================
  Files          23       25       +2     
  Lines        2296     2409     +113     
==========================================
+ Hits         2035     2151     +116     
+ Misses        261      258       -3
Impacted Files Coverage Δ
oblib/tests/test_data_model.py 99.41% <100%> (+0.03%) ⬆️
oblib/data_model.py 79.08% <94.44%> (+0.52%) ⬆️
oblib/tests/test_json_clips.py 92.1% <0%> (-7.9%) ⬇️
oblib/parser.py 72.55% <0%> (-2.54%) ⬇️
oblib/taxonomy_types.py 97.87% <0%> (ø) ⬆️
oblib/tests/test_parser.py 100% <0%> (ø) ⬆️
oblib/taxonomy.py 94.93% <0%> (ø) ⬆️
oblib/util.py 100% <0%> (ø) ⬆️
oblib/tests/test_taxonomy_semantic.py 100% <0%> (ø) ⬆️
oblib/taxonomy_misc.py 99.28% <0%> (ø) ⬆️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8765897...32b1d05. Read the comment docs.

oblib/data_model.py Outdated Show resolved Hide resolved
oblib/data_model.py Outdated Show resolved Hide resolved
@jonoxia jonoxia merged commit 262c64a into SunSpecOrangeButton:master Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants