Comments (3)
I think this might already be implemented, if i'm understanding correctly.
The more specific characteristics build on the more general ones -- for example, if you assert that a column has a minimum value, Orca_test will automatically check that it's numeric, can be generated, and is registered. So in the spec, you only need to list the characteristics that are independent of each other. This isn't in the documentation yet, but i'll add it.
Does this address the issue, or is there more we could be doing?
from orca_test.
Sorry for the late response. I looked at the code and indeed that's the way it is meant to be. But this test chaining only addresses part of my problem. For example, UrbanSim 1 requires no missing values in columns. If I imply the same logic in UrbanSim2, I need to have no missing test explicit to every data column, right? Same if I have most of my columns are numeric, why not just say "numeric=False" in the few remaining cases? It would be better to have a default setting for majority of the cases to simply the configs.
Thanks.
from orca_test.
I see what you mean. It does seem useful to be able to define context-specific defaults.
Some thoughts about implementation:
One approach would be to write a set()
method that would allow users to change an object's properties. This would come in handy in a variety of situations, and would look something like this:
col_defaults = ColumnSpec(numeric=True, missing=False)
t = TableSpec('buildings',
col_defaults.set(column_name='building_id'),
col_defaults.set(column_name='residential_price', min=0))
(The method would actually return a new object, to avoid problems with references.)
Or alternatively, we could modify the constructors to accept an existing spec that would serve as a base for the new object.
col_defaults = ColumnSpec(numeric=True, missing=False)
t = TableSpec('buildings',
ColumnSpec('building_id', base=col_defaults),
ColumnSpec('residential_price', min=0, base=col_defaults))
I can see both versions of the syntax being useful: the second seems clearer for setting default values, but the first is clearer if you want to modify an existing object. The functionality would be the same, so behind the scenes one could just point to the other.
from orca_test.
Related Issues (18)
- Ultra specific testing for debug purposes HOT 4
- YAML syntax and additional assertions on value consistency? HOT 3
- Overbroad Except Clauses HOT 4
- Split into multiple files HOT 1
- Complete a test with report on specific issues HOT 5
- Possible bug in missing value assertions HOT 2
- Write unit tests HOT 3
- Add Python 3 cross-compatibility HOT 1
- Standardize docstrings and put together Sphinx documentation
- Foreign_key test report additional/missing values HOT 1
- Error messages should put table name in a consistent spot
- What can we learn from engarde HOT 1
- Slow performance & redundant tests HOT 10
- categorical columns
- Raise an error when an undefined key is included in a spec
- More informative error message for max_portion_missing
- Warnings or reports rather than assertions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orca_test.