Skip to content

Commit 95ed551

Browse files
rc97
1 parent fca03d6 commit 95ed551

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
easy_ml (0.2.0.pre.rc96)
4+
easy_ml (0.2.0.pre.rc97)
55
activerecord
66
activerecord-import (~> 1.8.1)
77
activesupport

app/models/easy_ml/concerns/versionable.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ module Versionable
99
def bump_version(force: false)
1010
return version if version.present? && !force
1111

12-
tz = ActiveSupport::TimeZone.new(EasyML::Configuration.timezone)
12+
tz = ActiveSupport::TimeZone.new(EasyML::Support::UTC)
1313
orig_version = version
1414
prev_version = tz.parse(version.gsub(/_/, "")) if version
15-
timestamp = Time.current.in_time_zone(EasyML::Configuration.timezone)
15+
timestamp = Time.current.in_time_zone(EasyML::Support::UTC)
1616
timestamp = (prev_version + 1.second) if prev_version && compare_versions(timestamp, prev_version)
1717

1818
self.version = timestamp.strftime(STRING_FORMAT)
1919
end
2020

2121
def compare_versions(version1, version2)
22-
tz = ActiveSupport::TimeZone.new(EasyML::Configuration.timezone)
22+
tz = ActiveSupport::TimeZone.new(EasyML::Support::UTC)
2323
tz.parse(version1.strftime(STRING_FORMAT).gsub(/_/, "")) <= tz.parse(version2.strftime(STRING_FORMAT).gsub(/_/, ""))
2424
end
2525
end

app/models/easy_ml/model.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def formatted_model_type
267267

268268
def formatted_version
269269
return nil unless version
270-
UTC.parse(version).in_time_zone(EasyML::Configuration.timezone).strftime("%B %-d, %Y at %-l:%M %p")
270+
EasyML::Support::UTC.parse(version.gsub(/_/, "")).in_time_zone(EasyML::Configuration.timezone).strftime("%B %-d, %Y at %-l:%M %p")
271271
end
272272

273273
def last_run_at

easy_ml-0.2.0.pre.rc97.gem

932 KB
Binary file not shown.

lib/easy_ml/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module EasyML
4-
VERSION = "0.2.0-rc96"
4+
VERSION = "0.2.0-rc97"
55

66
module Version
77
end

spec/app/models/easy_ml/deploy_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ def relative_dir(dir)
137137

138138
describe "#deploy" do
139139
it "maintains dataset directory structure and versioning" do
140-
@t1 = EasyML::Support::EST.parse("2025-01-01").beginning_of_day
140+
@t1 = EasyML::Support::UTC.parse("2025-01-01").beginning_of_day
141141
Timecop.freeze(@t1)
142142

143143
mock_s3_upload
144144
model.save
145145
model.unlock!
146146

147-
@t2 = EasyML::Support::EST.parse("2025-01-02").beginning_of_day
147+
@t2 = EasyML::Support::UTC.parse("2025-01-02").beginning_of_day
148148
Timecop.freeze(@t2)
149149

150150
model.train(async: false)
@@ -177,7 +177,7 @@ def relative_dir(dir)
177177
model.dataset.columns.where(name: "Age").update_all(hidden: true)
178178
model.dataset.refresh
179179

180-
@t3 = EasyML::Support::EST.parse("2025-01-03").beginning_of_day
180+
@t3 = EasyML::Support::UTC.parse("2025-01-03").beginning_of_day
181181
Timecop.freeze(@t3)
182182

183183
model.train(async: false)
@@ -218,7 +218,7 @@ def relative_dir(dir)
218218

219219
it "uses deployed version for prediction" do
220220
mock_s3_upload
221-
@time = EasyML::Support::EST.now
221+
@time = EasyML::Support::UTC.now
222222
Timecop.freeze(@time)
223223

224224
model.save!
@@ -297,7 +297,7 @@ def relative_dir(dir)
297297
it "uses historical dataset when running predictions" do
298298
mock_s3_upload
299299

300-
@time = EasyML::Support::EST.now
300+
@time = EasyML::Support::UTC.now
301301
Timecop.freeze(@time)
302302

303303
model.save
@@ -375,22 +375,22 @@ def relative_dir(dir)
375375

376376
mock_s3_upload
377377

378-
@time = EasyML::Support::EST.parse("2024-01-01").beginning_of_day
378+
@time = EasyML::Support::UTC.parse("2024-01-01").beginning_of_day
379379
Timecop.freeze(@time)
380380

381381
model.save
382382
model.train(async: false)
383383

384-
Timecop.freeze(EasyML::Support::EST.parse("2024-02-02"))
384+
Timecop.freeze(EasyML::Support::UTC.parse("2024-02-02"))
385385

386386
model.deploy(async: false)
387387
model_v1 = model.current_version
388388

389389
def extract_timestamp(dir)
390-
EasyML::Support::EST.parse(dir.gsub(/\D/, ""))
390+
EasyML::Support::UTC.parse(dir.gsub(/\D/, ""))
391391
end
392392

393-
expect(extract_timestamp(model_v1.dataset.raw.dir)).to eq(EasyML::Support::EST.parse("2024-01-01"))
393+
expect(extract_timestamp(model_v1.dataset.raw.dir)).to eq(EasyML::Support::UTC.parse("2024-01-01"))
394394
# Creates a new folder for the next dataset version
395395
expect(extract_timestamp(model_v1.dataset.raw.dir)).to be < extract_timestamp(model.dataset.raw.dir)
396396
expect(extract_timestamp(model_v1.dataset.processed.dir)).to be < extract_timestamp(model.dataset.processed.dir)
@@ -479,7 +479,7 @@ def extract_timestamp(dir)
479479

480480
mock_s3_upload
481481

482-
@time = EasyML::Support::EST.now
482+
@time = EasyML::Support::UTC.now
483483
Timecop.freeze(@time)
484484

485485
model.save

0 commit comments

Comments
 (0)