cdss-ruby 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop.yml +86 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/README.md +101 -0
- data/Rakefile +26 -0
- data/docs/Cdss/AdminCalls.html +399 -0
- data/docs/Cdss/Analysis.html +972 -0
- data/docs/Cdss/Client.html +581 -0
- data/docs/Cdss/Climate.html +1257 -0
- data/docs/Cdss/Concerns/LogReadingAttributes.html +406 -0
- data/docs/Cdss/Concerns/WellReadingAttributes.html +414 -0
- data/docs/Cdss/Concerns.html +117 -0
- data/docs/Cdss/GroundWater.html +945 -0
- data/docs/Cdss/Models/AdminCall.html +252 -0
- data/docs/Cdss/Models/Analysis.html +397 -0
- data/docs/Cdss/Models/CallAnalysis.html +140 -0
- data/docs/Cdss/Models/ClimateStation.html +249 -0
- data/docs/Cdss/Models/DiversionRecord.html +248 -0
- data/docs/Cdss/Models/Reading.html +301 -0
- data/docs/Cdss/Models/ReferenceTable.html +339 -0
- data/docs/Cdss/Models/RouteAnalysis.html +140 -0
- data/docs/Cdss/Models/SourceRoute.html +140 -0
- data/docs/Cdss/Models/Station.html +248 -0
- data/docs/Cdss/Models/Structure.html +259 -0
- data/docs/Cdss/Models/WaterClass.html +249 -0
- data/docs/Cdss/Models/WaterRight.html +255 -0
- data/docs/Cdss/Models/Well.html +251 -0
- data/docs/Cdss/Models.html +117 -0
- data/docs/Cdss/Parser.html +2155 -0
- data/docs/Cdss/Parsers/AdminCallsParser.html +201 -0
- data/docs/Cdss/Parsers/AnalysisParser.html +296 -0
- data/docs/Cdss/Parsers/BaseParser.html +207 -0
- data/docs/Cdss/Parsers/ClimateParser.html +253 -0
- data/docs/Cdss/Parsers/ReadingParser.html +201 -0
- data/docs/Cdss/Parsers/ReferenceTablesParser.html +201 -0
- data/docs/Cdss/Parsers/StationParser.html +201 -0
- data/docs/Cdss/Parsers/StructuresParser.html +305 -0
- data/docs/Cdss/Parsers/WaterRightsParser.html +219 -0
- data/docs/Cdss/Parsers/WellParser.html +357 -0
- data/docs/Cdss/Parsers.html +117 -0
- data/docs/Cdss/ReferenceTables.html +332 -0
- data/docs/Cdss/Structures.html +1132 -0
- data/docs/Cdss/SurfaceWater.html +798 -0
- data/docs/Cdss/Telemetry.html +763 -0
- data/docs/Cdss/Utils.html +1276 -0
- data/docs/Cdss/WaterRights.html +634 -0
- data/docs/Cdss.html +292 -0
- data/docs/_index.html +493 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.README.html +108 -0
- data/docs/file_list.html +59 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +108 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +790 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/cdss/admin_calls.rb +44 -0
- data/lib/cdss/analysis.rb +183 -0
- data/lib/cdss/client.rb +121 -0
- data/lib/cdss/climate.rb +155 -0
- data/lib/cdss/concerns/log_reading_attributes.rb +48 -0
- data/lib/cdss/concerns/well_reading_attributes.rb +56 -0
- data/lib/cdss/ground_water.rb +112 -0
- data/lib/cdss/models/admin_call.rb +45 -0
- data/lib/cdss/models/analysis.rb +77 -0
- data/lib/cdss/models/climate_station.rb +40 -0
- data/lib/cdss/models/reading.rb +54 -0
- data/lib/cdss/models/reference_table.rb +56 -0
- data/lib/cdss/models/station.rb +40 -0
- data/lib/cdss/models/structure.rb +101 -0
- data/lib/cdss/models/water_right.rb +47 -0
- data/lib/cdss/models/well.rb +43 -0
- data/lib/cdss/parser.rb +172 -0
- data/lib/cdss/parsers/admin_calls_parser.rb +47 -0
- data/lib/cdss/parsers/analysis_parser.rb +124 -0
- data/lib/cdss/parsers/base_parser.rb +18 -0
- data/lib/cdss/parsers/climate_parser.rb +86 -0
- data/lib/cdss/parsers/reading_parser.rb +90 -0
- data/lib/cdss/parsers/reference_tables_parser.rb +55 -0
- data/lib/cdss/parsers/station_parser.rb +42 -0
- data/lib/cdss/parsers/structures_parser.rb +96 -0
- data/lib/cdss/parsers/water_rights_parser.rb +77 -0
- data/lib/cdss/parsers/well_parser.rb +107 -0
- data/lib/cdss/reference_tables.rb +147 -0
- data/lib/cdss/structures.rb +235 -0
- data/lib/cdss/surface_water.rb +186 -0
- data/lib/cdss/telemetry.rb +98 -0
- data/lib/cdss/utils.rb +152 -0
- data/lib/cdss/version.rb +5 -0
- data/lib/cdss/water_rights.rb +95 -0
- data/lib/cdss.rb +27 -0
- data/sig/cdss/ruby.rbs +6 -0
- metadata +272 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 15ae6061a3db3c8ead6608a242d547acec504d2eb5b2bc635c951cecb077e938
|
4
|
+
data.tar.gz: 3df958bf305f3323ef4439624f61e7f945c108e6b1e51f1d07f9a8d925730297
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 54ed6ca04a155d58d3ad74c18425e5658b728c7b58c2d5c8289c9bc0947a103468e7b74d8bd59d056c2f6c18790ffa2e5f8eb74c973aae44bbcaca39848d4b62
|
7
|
+
data.tar.gz: 9dd2ba9da24e945278f265e223e687ec141d702a190efe163f0944bef3e1c2ff32a7af9a8beb18d6d0bafdc0e4509a5545063b7672e07f5f4b9657b27c29ca7b
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
# .rubocop.yml
|
2
|
+
require:
|
3
|
+
- rubocop-minitest
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.7
|
7
|
+
NewCops: enable
|
8
|
+
|
9
|
+
# Allow development dependencies in gemspec
|
10
|
+
Gemspec/DevelopmentDependencies:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
# Make documentation optional for most files
|
14
|
+
Style/Documentation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
# Allow unused arguments (often needed for API compatibility)
|
18
|
+
Lint/UnusedMethodArgument:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
# Allow missing super in inherited callbacks
|
22
|
+
Lint/MissingSuper:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
# Allow private class methods to be defined normally
|
26
|
+
Lint/IneffectiveAccessModifier:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
# Allow longer classes and modules for better organization
|
30
|
+
Metrics/ClassLength:
|
31
|
+
Max: 200
|
32
|
+
Exclude:
|
33
|
+
- 'test/**/*'
|
34
|
+
|
35
|
+
Metrics/ModuleLength:
|
36
|
+
Max: 200
|
37
|
+
|
38
|
+
# Allow more reasonable method lengths
|
39
|
+
Metrics/MethodLength:
|
40
|
+
Max: 40
|
41
|
+
Exclude:
|
42
|
+
- 'test/**/*'
|
43
|
+
|
44
|
+
Metrics/AbcSize:
|
45
|
+
Max: 50
|
46
|
+
Exclude:
|
47
|
+
- 'test/**/*'
|
48
|
+
|
49
|
+
Metrics/CyclomaticComplexity:
|
50
|
+
Max: 12
|
51
|
+
|
52
|
+
Metrics/PerceivedComplexity:
|
53
|
+
Max: 12
|
54
|
+
|
55
|
+
# Allow longer parameter lists for API methods
|
56
|
+
Metrics/ParameterLists:
|
57
|
+
Max: 10
|
58
|
+
CountKeywordArgs: false
|
59
|
+
|
60
|
+
# Allow longer lines, especially for documentation
|
61
|
+
Layout/LineLength:
|
62
|
+
Max: 150
|
63
|
+
Exclude:
|
64
|
+
- 'test/**/*'
|
65
|
+
|
66
|
+
# Allow larger blocks in tests
|
67
|
+
Metrics/BlockLength:
|
68
|
+
Exclude:
|
69
|
+
- 'test/**/*'
|
70
|
+
- '*.gemspec'
|
71
|
+
|
72
|
+
# Other style preferences
|
73
|
+
Style/StringLiterals:
|
74
|
+
EnforcedStyle: double_quotes
|
75
|
+
|
76
|
+
Lint/DuplicateMethods:
|
77
|
+
Exclude:
|
78
|
+
- 'test/**/*'
|
79
|
+
|
80
|
+
Style/FrozenStringLiteralComment:
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
Lint/Void:
|
84
|
+
Exclude:
|
85
|
+
- test/cdss/test_analysis.rb
|
86
|
+
- test/cdss/test_structures.rb
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at mattm3646@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/README.md
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# **cdss-ruby**
|
2
|
+
|
3
|
+
|
4
|
+
[](https://github.com/mgm702/cdss-ruby/actions)
|
5
|
+
[](https://badge.fury.io/rb/cdss-ruby)
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
7
|
+
|
8
|
+
[**« CDSS »**](https://dwr.state.co.us/Tools)
|
9
|
+
|
10
|
+
[**CDSS REST Web**](https://dwr.state.co.us/Rest/GET/Help)
|
11
|
+
|
12
|
+
|
13
|
+
The goal of [**`cdss-ruby`**](https://rubygems.org/gems/cdss-ruby) is to provide functions that help Ruby users to navigate, explore, and make requests to the CDSS REST API web service.
|
14
|
+
|
15
|
+
The Colorado's Decision Support Systems (CDSS) is a water management system created and developed by the Colorado Water Conservation Board (CWCB) and the Colorado Division of Water Resources (DWR).
|
16
|
+
|
17
|
+
Thank you to those at CWCB and DWR for providing an accessible and well documented REST API!
|
18
|
+
|
19
|
+
|
20
|
+
> See [**`cdssr`**](https://github.com/anguswg-ucsb/cdssr), for the **R** version of this package
|
21
|
+
|
22
|
+
> See [**`cdsspy`**](https://github.com/anguswg-ucsb/cdsspy), for the **Python** version of this package
|
23
|
+
|
24
|
+
---
|
25
|
+
|
26
|
+
- [**cdssr (R)**](https://github.com/anguswg-ucsb/cdssr)
|
27
|
+
|
28
|
+
- [**cdssr documentation**](https://anguswg-ucsb.github.io/cdssr/)
|
29
|
+
|
30
|
+
- [**cdsspy (Python)**](https://github.com/anguswg-ucsb/cdsspy)
|
31
|
+
|
32
|
+
- [**cdsspy documentation**](https://pypi.org/project/cdsspy/)
|
33
|
+
|
34
|
+
- [**cdss-ruby (Ruby)**](https://github.com/mgm702/cdss-ruby)
|
35
|
+
|
36
|
+
- [**cdss-ruby documentation**](https://mgm702.com/cdss-ruby/)
|
37
|
+
|
38
|
+
---
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
## **Installation**
|
43
|
+
|
44
|
+
Add this line to your application's Gemfile:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
gem 'cdss-ruby'
|
48
|
+
```
|
49
|
+
and then execute
|
50
|
+
```ruby
|
51
|
+
bundle install
|
52
|
+
```
|
53
|
+
|
54
|
+
or install it yourself as:
|
55
|
+
```bash
|
56
|
+
gem install cdss-ruby
|
57
|
+
```
|
58
|
+
|
59
|
+
## **Getting Started**
|
60
|
+
|
61
|
+
Using the gem is simple. Create a client and start making requests:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
irb(main):001:0> @client = Cdss.client
|
65
|
+
=> #<Cdss::Client:0x0000000103f757c0 @api_key=nil, @options={}>
|
66
|
+
irb(main):002:0> @client.get_sw_stations
|
67
|
+
```
|
68
|
+
|
69
|
+
## **Available Endpoints**
|
70
|
+
|
71
|
+
The `cdss-ruby` gem provides access to all CDSS API endpoints through an intuitive interface. For detailed documentation on each endpoint and its methods, please visit our [documentation site](https://mgm702.com/cdss-ruby).
|
72
|
+
Here are some key modules:
|
73
|
+
|
74
|
+
* [Cdss::AdminCalls](https://mgm702.com/cdss-ruby/Cdss/AdminCalls.html) - Access administrative calls and structure data
|
75
|
+
* [Cdss::Climate](https://mgm702.com/cdss-ruby/Cdss/Climate.html) - Get climate station data and time series
|
76
|
+
* [Cdss::Groundwater](https://mgm702.com/cdss-ruby/Cdss/GroundWater.html) - Access groundwater well data and measurements
|
77
|
+
* [Cdss::ReferenceTables](https://mgm702.com/cdss-ruby/Cdss/ReferenceTables.html) - Get reference tables
|
78
|
+
* [Cdss::SurfaceWater](https://mgm702.com/cdss-ruby/Cdss/SurfaceWater.html) - Access surface water stations and time series
|
79
|
+
* [Cdss::Telemetry](https://mgm702.com/cdss-ruby/Cdss/Telemetry.html) - Get telemetry station data and time series
|
80
|
+
* [Cdss::WaterRights](https://mgm702.com/cdss-ruby/Cdss/WaterRights.html) - Access water rights net amounts and transactions
|
81
|
+
* [Cdss::Analysis](https://mgm702.com/cdss-ruby/Cdss/Analysis.html) - Perform call analysis and get source route frameworks
|
82
|
+
|
83
|
+
## **Development**
|
84
|
+
|
85
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
86
|
+
|
87
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
88
|
+
|
89
|
+
## Contributing
|
90
|
+
|
91
|
+
If you would like to contribute to this plugin, submit a Pull Request with an excellent commit message.
|
92
|
+
Contributions are more then welcome, however please make sure that your commit message is clear and understandable.
|
93
|
+
|
94
|
+
## License
|
95
|
+
|
96
|
+
The cdss-ruby gem is licensed under the MIT license.
|
97
|
+
|
98
|
+
## Like The Gem?
|
99
|
+
|
100
|
+
If you like Tabtastic.vim follow the repository on [Github](https://github.com/mgm702/vim-tabtastic) and if you are feeling extra nice, follow the author [mgm702](http://mgm702.com) on [Twitter](https://twitter.com/mgm702) or [Github](https://github.com/mgm702).
|
101
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
17
|
+
|
18
|
+
require "yard"
|
19
|
+
|
20
|
+
YARD::Rake::YardocTask.new do |t|
|
21
|
+
t.options = ["--output-dir", "docs"]
|
22
|
+
end
|
23
|
+
|
24
|
+
task :publish_docs do
|
25
|
+
sh "git subtree push --prefix docs origin gh-pages"
|
26
|
+
end
|