urbanopt-cli 0.2.0.pre1 → 0.2.0.pre2
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 +4 -4
- data/lib/uo_cli/version.rb +1 -1
- data/lib/uo_cli.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca96f837d103dad09458b5ab9a71fdc856572d7d
|
4
|
+
data.tar.gz: 7dd3b0c50153c6a5ca9d857948d6c215c8730cfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe3e035b0a66367be25164ec350c6a735c534fcdef8ef0ea30fb6fab2bd089651d969587f8a2dafb50652f92cf51452608c4db33ab0a01c29c50358230a85f3
|
7
|
+
data.tar.gz: e1c5d9b3c523d38aca1f76a3e738966d1a08f8774d3f560efaac2af6137a1986e457b54816b50113fe2daeb4ad9a4e0422083c4acea10ea6aa315fed64f01eec
|
data/lib/uo_cli/version.rb
CHANGED
data/lib/uo_cli.rb
CHANGED
@@ -108,10 +108,12 @@ module URBANopt
|
|
108
108
|
# +feature_file_path+:: _string_ Path to Feature File used to describe set of features in the district
|
109
109
|
#
|
110
110
|
# FIXME: This only works when scenario_file and feature_file are in the project root directory
|
111
|
+
# This works when called with filename (from inside project directory) and with absolute filepaths
|
111
112
|
# Also, feels a little weird that now I'm only using instance variables and not passing anything to this function. I guess it's ok?
|
112
113
|
def self.run_func
|
113
|
-
name = "#{@scenario_folder}"
|
114
114
|
root_dir = File.dirname(File.absolute_path(@user_input[:scenario]))
|
115
|
+
scenario_basename = File.basename(File.absolute_path(@user_input[:scenario]))
|
116
|
+
name = File.basename(scenario_basename, File.extname(scenario_basename))
|
115
117
|
run_dir = File.join(root_dir, 'run', name.downcase)
|
116
118
|
|
117
119
|
if @feature_id
|
@@ -122,7 +124,7 @@ module URBANopt
|
|
122
124
|
end
|
123
125
|
end
|
124
126
|
|
125
|
-
csv_file = File.join(root_dir,
|
127
|
+
csv_file = File.join(root_dir, scenario_basename)
|
126
128
|
featurefile = File.join(root_dir, @feature_name)
|
127
129
|
mapper_files_dir = File.join(root_dir, "mappers")
|
128
130
|
num_header_rows = 1
|
@@ -149,7 +151,10 @@ module URBANopt
|
|
149
151
|
:headers => ["Feature Id","Feature Name","Mapper Class"]) do |csv|
|
150
152
|
feature_file_json[:features].each do |feature|
|
151
153
|
if feature_id == 'SKIP'
|
152
|
-
|
154
|
+
# ensure that feature is a building
|
155
|
+
if feature[:properties][:type] == "Building"
|
156
|
+
csv << [feature[:properties][:id], feature[:properties][:name], "URBANopt::Scenario::#{mapper_name}Mapper"]
|
157
|
+
end
|
153
158
|
elsif feature_id == feature[:properties][:id].to_i
|
154
159
|
csv << [feature[:properties][:id], feature[:properties][:name], "URBANopt::Scenario::#{mapper_name}Mapper"]
|
155
160
|
elsif
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanopt-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.pre2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|