Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setup(self):
lon = np.array((4.99, 5, 5.01))
self.coordinates = np.array([(lati, loni) for
(lati, loni) in zip(lat, lon)])
self.times = pd.date_range('2019-01-01', freq='1T', periods=self.n)
self.times = pd.date_range('2019-01-01', freq='1min', periods=self.n)
self.positions = np.array([[0, 0], [100, 0], [100, 100], [0, 100]])
self.clearsky_index = pd.Series(np.random.rand(self.n),
index=self.times)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/adr-pvarray/plot_fit_to_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
25 1000 75.0 273.651
26 1100 75.0 301.013
'''
df = pd.read_csv(StringIO(iec61853data), delim_whitespace=True)
df = pd.read_csv(StringIO(iec61853data), sep=r"\s+")

# %%
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

solar_position = pvlib.solarposition.get_solarposition(
# TMY timestamp is at end of hour, so shift to center of interval
tmy.index.shift(freq="-30T"),
tmy.index.shift(freq="-30min"),
latitude=metadata["latitude"],
longitude=metadata["longitude"],
altitude=metadata["altitude"],
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/bifacial/plot_bifi_model_mc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# create site location and times characteristics
lat, lon = 36.084, -79.817
tz = 'Etc/GMT+5'
times = pd.date_range('2021-06-21', '2021-6-22', freq='1T', tz=tz)
times = pd.date_range('2021-06-21', '2021-6-22', freq='1min', tz=tz)

# create site system characteristics
axis_tilt = 0
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/bifacial/plot_bifi_model_pvwatts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# using Greensboro, NC for this example
lat, lon = 36.084, -79.817
tz = 'Etc/GMT+5'
times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz=tz)
times = pd.date_range('2021-06-21', '2021-06-22', freq='1min', tz=tz)

# create location object and get clearsky data
site_location = location.Location(lat, lon, tz=tz, name='Greensboro, NC')
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/bifacial/plot_pvfactors_fixed_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# %%
# First, generate the usual modeling inputs:

times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz='Etc/GMT+5')
times = pd.date_range('2021-06-21', '2021-06-22', freq='1min', tz='Etc/GMT+5')
loc = location.Location(latitude=40, longitude=-80, tz=times.tz)
sp = loc.get_solarposition(times)
cs = loc.get_clearsky(times)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@

solar_position = pvlib.solarposition.get_solarposition(
# TMY timestamp is at end of hour, so shift to center of interval
tmy.index.shift(freq='-30T'),
tmy.index.shift(freq='-30min'),
latitude=metadata['latitude'],
longitude=metadata['longitude'],
altitude=metadata['altitude'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# NOTE: TMY3 files timestamps indicate the end of the hour, so shift indices
# back 30-minutes to calculate solar position at center of the interval
solpos = get_solarposition(
greensboro.index.shift(freq="-30T"), latitude=metadata['latitude'],
greensboro.index.shift(freq="-30min"), latitude=metadata['latitude'],
longitude=metadata['longitude'], altitude=metadata['altitude'],
pressure=greensboro.pressure*100, # convert from millibar to Pa
temperature=greensboro.temp_air)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ def get_orientation(self, solar_zenith, solar_azimuth):
'Seasonal 20/40 Production': mc.results.ac,
'Fixed 30 Production': mc2.results.ac,
})
results.resample('m').sum().plot()
results.resample('ME').sum().plot()
plt.ylabel('Monthly Production')
plt.show()
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def calculate_poa(tmy, solar_position, surface_tilt, surface_azimuth):
column_name = f"FT-{tilt}"
# TMYs are hourly, so we can just sum up irradiance [W/m^2] to get
# insolation [Wh/m^2]:
df_monthly[column_name] = poa_irradiance.resample('m').sum()
df_monthly[column_name] = poa_irradiance.resample('ME').sum()

# single-axis tracking:
orientation = tracking.singleaxis(solar_position['apparent_zenith'],
Expand All @@ -95,10 +95,10 @@ def calculate_poa(tmy, solar_position, surface_tilt, surface_azimuth):
solar_position,
orientation['surface_tilt'],
orientation['surface_azimuth'])
df_monthly['SAT-0.4'] = poa_irradiance.resample('m').sum()
df_monthly['SAT-0.4'] = poa_irradiance.resample('ME').sum()

# calculate the percent difference from GHI
ghi_monthly = tmy['ghi'].resample('m').sum()
ghi_monthly = tmy['ghi'].resample('ME').sum()
df_monthly = 100 * (df_monthly.divide(ghi_monthly, axis=0) - 1)

df_monthly.plot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

# Set times in the morning of the December solstice.
times = pd.date_range(
'2020-12-20 6:30', '2020-12-20 9:00', freq='1T', tz=tz
'2020-12-20 6:30', '2020-12-20 9:00', freq='1min', tz=tz
)

# Create location object, and get solar position and clearsky irradiance data.
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/solar-position/plot_sunpath_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
tz = 'Asia/Calcutta'
lat, lon = 28.6, 77.2

times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz)
times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='h', tz=tz)
solpos = solarposition.get_solarposition(times, lat, lon)
# remove nighttime
solpos = solpos.loc[solpos['apparent_elevation'] > 0, :]
Expand Down Expand Up @@ -112,7 +112,7 @@

tz = 'Asia/Calcutta'
lat, lon = 28.6, 77.2
times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='H', tz=tz)
times = pd.date_range('2019-01-01 00:00:00', '2020-01-01', freq='h', tz=tz)

solpos = solarposition.get_solarposition(times, lat, lon)
# remove nighttime
Expand Down
Loading