Skip to content

Commit

Permalink
deploy: 3592bce
Browse files Browse the repository at this point in the history
  • Loading branch information
IoannisSifnaios committed Jun 24, 2024
1 parent 9e24be2 commit 3dc0713
Show file tree
Hide file tree
Showing 21 changed files with 1,416 additions and 14 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions _sources/posts/gsoc_weeks_3_and_4.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Google Summer Of Code 2024 - Weeks 3 and 4
```{post} 2024-06-24
:author: Ioannis Sifnaios
:tags: pvlib, github, open science, gsoc
```

So GSoC goes on strong, and almost one month has passed since the start of the coding period! I have to admit that I feel much more comfortable with [GitHub](https://github.com/) and the structure of [pvlib](https://github.com/pvlib/pvlib-python), which really makes a difference in progressing with my GSoC tasks. Of course, the main reason is the incredible amount of help I have received from my mentors [Adam R. Jensen](https://github.com/AdamRJensen) and [Kevin Anderson](https://github.com/kandersolar), but also from my fellow GSoC students [Echedey Luis](https://github.com/echedey-ls) and [Rajiv Daxini](https://github.com/RDaxini). Overall, my GSoC experience proves just how strong the open science community is and how willing people are to assist even newbie programmers who have many questions.

Over the last two weeks, I actually achieved my first big milestone; I got two of my PRs merged into the main pvlib code (yay!). The new release of pvlib ([v0.11.0](https://pvlib-python.readthedocs.io/en/stable/whatsnew.html)) was announced on June 21$^{st}$, and I am so happy to see my name in the contributors' list!

One of the things I recently spent more time on was function tests. Honestly, it feels like this is where magic happens... I feel like the more sophisticated the topics, the less intuitive the commands are! So, I can't really say that I understand exactly why things are working, but they do! Thus, I will try to share what I've understood so far...

Pvlib's tests are done using pytest. Pytest is a popular testing framework for Python that allows developers to write simple and scalable test cases for their code. It provides a robust set of tools to ensure code quality and reliability. Pytest can handle everything from simple unit tests to complex functional and integration tests. So far, I have only used fixtures and parametrized tests.

Fixtures in pytest are functions that can set up the necessary state or context for tests, making it easier to manage setup and teardown tasks. They are reusable and can be used to provide a consistent test environment. For example, in the code below, I used fixtures to define a reusable setup function that can be used across multiple test functions, thus making the test code cleaner and more modular.

```
@pytest.fixture
def times():
return pd.date_range(start="2015-01-01 00:00", end="2015-01-07 00:00", freq="1d")

@pytest.fixture
def air_temps(times):
return pd.Series([-15, -5, 2.5, 15, 20, 30, 40], index=times)

@pytest.fixture
def water_temps_expected(times):
return pd.Series([np.nan, 1.25, 6.875, 16.25, 20, 27.5, 35], index=times)

def test_stream_temperature_stefan_ndarray(air_temps, water_temps_expected):
result = floating.stream_temperature_stefan(temp_air=air_temps.to_numpy())
assert_allclose(water_temps_expected.to_numpy(), result)

def test_stream_temperature_stefan_series(air_temps, water_temps_expected):
result = floating.stream_temperature_stefan(temp_air=air_temps)
assert_series_equal(water_temps_expected, result)
```

Apart from fixtures, I also used parameterized tests. Parametrized tests in pytest allow you to run a single test function with multiple sets of parameters, enhancing your ability to efficiently test different inputs and scenarios. This helps in reducing redundancy and improving test coverage. In the example below, I check if passing the value on the left (e.g., -5) returns the value on the right (e.g., 1.25).

```
@pytest.mark.parametrize('air_temp,water_temp', [
(-15, np.nan),
(-5, 1.25),
(40, 35),
])
def test_stream_temperature_stefan(air_temp, water_temp):
result = floating.stream_temperature_stefan(air_temp)
assert_allclose(result, water_temp)
```

Tests are used to ensure that the functions that we add to pvlib work as expected. It is thus crucial to include all "extreme" cases that could occur in the tests and test potential warning and error messages.

The progress of my project is described in [this issue](https://github.com/pvlib/pvlib-python/issues/2068). Stay tuned for updates!
86 changes: 85 additions & 1 deletion blog/2024/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ <h3>
<ul>


<li>
<a href="../../posts/gsoc_weeks_3_and_4/">
24 June - Google Summer Of Code 2024 - Weeks 3 and 4
</a>
</li>

<li>
<a href="../../posts/gsoc_weeks_1_and_2/">
08 June - Google Summer Of Code 2024 - Weeks 1 and 2
Expand All @@ -335,7 +341,7 @@ <h3>


<li>
<a href="#">2024 (2)</a>
<a href="#">2024 (3)</a>
</li>


Expand Down Expand Up @@ -405,6 +411,84 @@ <h1>
</h1>


<div class="section ablog-post">
<h2 class="ablog-post-title">
<a href="../../posts/gsoc_weeks_3_and_4/">Google Summer Of Code 2024 - Weeks 3 and 4</a>
</h2>
<ul class="ablog-archive">
<li>


<i class="fa fa-calendar"></i>

<span>24 June 2024</span>

</li>
<div class="ablog-sidebar-item ablog__postcard2">


<li id="ablog-sidebar-item author ablog__author">
<span>

<i class="fa-fw fa fa-user"></i>

</span>


<a href="../author/ioannis-sifnaios/">Ioannis Sifnaios</a>



</li>





<li id="ablog-sidebar-item tags ablog__tags">
<span>


<i class="fa-fw fa fa-tags"></i>


</span>


<a href="../tag/pvlib/">pvlib</a>





<a href="../tag/github/">github</a>





<a href="../tag/open-science/">open science</a>





<a href="../tag/gsoc/">gsoc</a>



</li>


</div>
</ul>
<p class="ablog-post-excerpt"><p>So GSoC goes on strong, and almost one month has passed since the start of the coding period! I have to admit that I feel much more comfortable with <a class="reference external" href="https://github.com/">GitHub</a> and the structure of <a class="reference external" href="https://github.com/pvlib/pvlib-python">pvlib</a>, which really makes a difference in progressing with my GSoC tasks. Of course, the main reason is the incredible amount of help I have received from my mentors <a class="reference external" href="https://github.com/AdamRJensen">Adam R. Jensen</a> and <a class="reference external" href="https://github.com/kandersolar">Kevin Anderson</a>, but also from my fellow GSoC students <a class="reference external" href="https://github.com/echedey-ls">Echedey Luis</a> and <a class="reference external" href="https://github.com/RDaxini">Rajiv Daxini</a>. Overall, my GSoC experience proves just how strong the open science community is and how willing people are to assist even newbie programmers who have many questions.</p>
</p>

<p class="ablog-post-expand"><a href="../../posts/gsoc_weeks_3_and_4/"><em>Read more ...</em></a></p>
<hr/>
</div>

<div class="section ablog-post">
<h2 class="ablog-post-title">
<a href="../../posts/gsoc_weeks_1_and_2/">Google Summer Of Code 2024 - Weeks 1 and 2</a>
Expand Down
20 changes: 19 additions & 1 deletion blog/archive/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ <h3>
<ul>


<li>
<a href="../../posts/gsoc_weeks_3_and_4/">
24 June - Google Summer Of Code 2024 - Weeks 3 and 4
</a>
</li>

<li>
<a href="../../posts/gsoc_weeks_1_and_2/">
08 June - Google Summer Of Code 2024 - Weeks 1 and 2
Expand All @@ -335,7 +341,7 @@ <h3>


<li>
<a href="../2024/">2024 (2)</a>
<a href="../2024/">2024 (3)</a>
</li>


Expand Down Expand Up @@ -402,6 +408,18 @@ <h2>
</span>
</h2>

<div class="section ablog__catalog_post">
<p>

<span>24 June 2024</span>

-
<a href="../../posts/gsoc_weeks_3_and_4/"
>Google Summer Of Code 2024 - Weeks 3 and 4</a
>
</p>
</div>

<div class="section ablog__catalog_post">
<p>

Expand Down
20 changes: 19 additions & 1 deletion blog/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<id>https://ioannissifnaios.github.io/</id>
<title>Blog</title>
<updated>2024-06-12T15:53:30.873319+00:00</updated>
<updated>2024-06-24T21:28:46.725484+00:00</updated>
<link href="https://ioannissifnaios.github.io/"/>
<link href="https://ioannissifnaios.github.io/blog/atom.xml" rel="self"/>
<generator uri="https://ablog.readthedocs.io/" version="0.11.10">ABlog</generator>
<entry>
<id>https://ioannissifnaios.github.io/posts/gsoc_weeks_3_and_4/</id>
<title>Google Summer Of Code 2024 - Weeks 3 and 4</title>
<updated>2024-06-24T00:00:00+00:00</updated>
<author>
<name>Ioannis Sifnaios</name>
</author>
<content type="html">&lt;p class="ablog-post-excerpt"&gt;&lt;p&gt;So GSoC goes on strong, and almost one month has passed since the start of the coding period! I have to admit that I feel much more comfortable with &lt;a class="reference external" href="https://github.com/"&gt;GitHub&lt;/a&gt; and the structure of &lt;a class="reference external" href="https://github.com/pvlib/pvlib-python"&gt;pvlib&lt;/a&gt;, which really makes a difference in progressing with my GSoC tasks. Of course, the main reason is the incredible amount of help I have received from my mentors &lt;a class="reference external" href="https://github.com/AdamRJensen"&gt;Adam R. Jensen&lt;/a&gt; and &lt;a class="reference external" href="https://github.com/kandersolar"&gt;Kevin Anderson&lt;/a&gt;, but also from my fellow GSoC students &lt;a class="reference external" href="https://github.com/echedey-ls"&gt;Echedey Luis&lt;/a&gt; and &lt;a class="reference external" href="https://github.com/RDaxini"&gt;Rajiv Daxini&lt;/a&gt;. Overall, my GSoC experience proves just how strong the open science community is and how willing people are to assist even newbie programmers who have many questions.&lt;/p&gt;
&lt;/p&gt;
</content>
<link href="https://ioannissifnaios.github.io/posts/gsoc_weeks_3_and_4/"/>
<summary>So GSoC goes on strong, and almost one month has passed since the start of the coding period! I have to admit that I feel much more comfortable with GitHub and the structure of pvlib, which really makes a difference in progressing with my GSoC tasks. Of course, the main reason is the incredible amount of help I have received from my mentors Adam R. Jensen and Kevin Anderson, but also from my fellow GSoC students Echedey Luis and Rajiv Daxini. Overall, my GSoC experience proves just how strong the open science community is and how willing people are to assist even newbie programmers who have many questions.</summary>
<category term="github" label="github"/>
<category term="gsoc" label="gsoc"/>
<category term="openscience" label="open science"/>
<category term="pvlib" label="pvlib"/>
<published>2024-06-24T00:00:00+00:00</published>
</entry>
<entry>
<id>https://ioannissifnaios.github.io/posts/gsoc_weeks_1_and_2/</id>
<title>Google Summer Of Code 2024 - Weeks 1 and 2</title>
Expand Down
20 changes: 19 additions & 1 deletion blog/author/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ <h3>
<ul>


<li>
<a href="../../posts/gsoc_weeks_3_and_4/">
24 June - Google Summer Of Code 2024 - Weeks 3 and 4
</a>
</li>

<li>
<a href="../../posts/gsoc_weeks_1_and_2/">
08 June - Google Summer Of Code 2024 - Weeks 1 and 2
Expand All @@ -335,7 +341,7 @@ <h3>


<li>
<a href="../2024/">2024 (2)</a>
<a href="../2024/">2024 (3)</a>
</li>


Expand Down Expand Up @@ -402,6 +408,18 @@ <h2>
</span>
</h2>

<div class="section ablog__catalog_post">
<p>

<span>24 June 2024</span>

-
<a href="../../posts/gsoc_weeks_3_and_4/"
>Google Summer Of Code 2024 - Weeks 3 and 4</a
>
</p>
</div>

<div class="section ablog__catalog_post">
<p>

Expand Down
86 changes: 85 additions & 1 deletion blog/author/ioannis-sifnaios/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,12 @@ <h3>
<ul>


<li>
<a href="../../../posts/gsoc_weeks_3_and_4/">
24 June - Google Summer Of Code 2024 - Weeks 3 and 4
</a>
</li>

<li>
<a href="../../../posts/gsoc_weeks_1_and_2/">
08 June - Google Summer Of Code 2024 - Weeks 1 and 2
Expand All @@ -335,7 +341,7 @@ <h3>


<li>
<a href="../../2024/">2024 (2)</a>
<a href="../../2024/">2024 (3)</a>
</li>


Expand Down Expand Up @@ -405,6 +411,84 @@ <h1>
</h1>


<div class="section ablog-post">
<h2 class="ablog-post-title">
<a href="../../../posts/gsoc_weeks_3_and_4/">Google Summer Of Code 2024 - Weeks 3 and 4</a>
</h2>
<ul class="ablog-archive">
<li>


<i class="fa fa-calendar"></i>

<span>24 June 2024</span>

</li>
<div class="ablog-sidebar-item ablog__postcard2">


<li id="ablog-sidebar-item author ablog__author">
<span>

<i class="fa-fw fa fa-user"></i>

</span>


<a href="#">Ioannis Sifnaios</a>



</li>





<li id="ablog-sidebar-item tags ablog__tags">
<span>


<i class="fa-fw fa fa-tags"></i>


</span>


<a href="../../tag/pvlib/">pvlib</a>





<a href="../../tag/github/">github</a>





<a href="../../tag/open-science/">open science</a>





<a href="../../tag/gsoc/">gsoc</a>



</li>


</div>
</ul>
<p class="ablog-post-excerpt"><p>So GSoC goes on strong, and almost one month has passed since the start of the coding period! I have to admit that I feel much more comfortable with <a class="reference external" href="https://github.com/">GitHub</a> and the structure of <a class="reference external" href="https://github.com/pvlib/pvlib-python">pvlib</a>, which really makes a difference in progressing with my GSoC tasks. Of course, the main reason is the incredible amount of help I have received from my mentors <a class="reference external" href="https://github.com/AdamRJensen">Adam R. Jensen</a> and <a class="reference external" href="https://github.com/kandersolar">Kevin Anderson</a>, but also from my fellow GSoC students <a class="reference external" href="https://github.com/echedey-ls">Echedey Luis</a> and <a class="reference external" href="https://github.com/RDaxini">Rajiv Daxini</a>. Overall, my GSoC experience proves just how strong the open science community is and how willing people are to assist even newbie programmers who have many questions.</p>
</p>

<p class="ablog-post-expand"><a href="../../../posts/gsoc_weeks_3_and_4/"><em>Read more ...</em></a></p>
<hr/>
</div>

<div class="section ablog-post">
<h2 class="ablog-post-title">
<a href="../../../posts/gsoc_weeks_1_and_2/">Google Summer Of Code 2024 - Weeks 1 and 2</a>
Expand Down
Loading

0 comments on commit 3dc0713

Please sign in to comment.