Python Morsels: Python Big O: the time complexities of different data structures in Python

Planet Python - Tue, 2024-04-16 11:00

The time complexity of common operations on Python's many data structures.

Table of contents

  1. Time Complexity ⏱️
  2. List 📋
  3. Double-Ended Queue ↔️
  4. Dictionary 🗝️
  5. Set 🎨
  6. Counter 🧮
  7. Heap / Priority Queue ⛰️
  8. Sorted List 🔤
  9. Traversal Techniques 🔍
  10. Other Data Structures? 📚
  11. Beware of Loops-in-Loops! 🤯
  12. Mind Your Data Structures 🗃️

Time Complexity ⏱️

Time complexity is one of those Computer Science concepts that's scary in its purest form, but often fairly practical as a rough "am I doing this right" measurement.

In the words of Ned Batchelder, time complexity is all about "how your code slows as your data grows".

Time complexity is usually discussed in terms of "Big O" notation. This is basically a way to discuss the order of magnitude for a given operation while ignoring the exact number of computations it needs. In "Big O" land, we don't care if something is twice as slow, but we do care whether it's n times slower where n is the length of our list/set/slice/etc.

Here's a graph of the common time complexity curves:

Remember that these lines are simply about orders of magnitude. If an operation is on the order of n, that means 100 times more data will slow things down about 100 times. If an operation is on the order of n² (that's n*n), that means 100 times more data will slow things down 100*100 times.

I usually think about those curves in terms of what would happen if we suddenly had 1,000 times more data to work with:

  • O(1): no change in time (constant time!)
  • O(log n): ~10 times slow down
  • O(n): 1,000 times slow down
  • O(n log n): 10,000 times slow down
  • O(n²): 1,000,000 times slow down! 😲

With that very quick recap behind us, let's take a look at the relative speeds of all common operations on each of Python's data structures.

List 📋

Python's lists are similar to …

Read the full article: https://www.pythonmorsels.com/time-complexities/
Categories: FLOSS Project Planets

Real Python: Using raise for Effective Exceptions

Planet Python - Tue, 2024-04-16 10:00

In your Python journey, you’ll come across situations where you need to signal that something is going wrong in your code. For example, maybe a file doesn’t exist, a network or database connection fails, or your code gets invalid input. A common approach to tackle these issues is to raise an exception, notifying the user that an error has occurred. That’s what Python’s raise statement is for.

Learning about the raise statement allows you to effectively handle errors and exceptional situations in your code. This way, you’ll develop more robust programs and higher-quality code.

In this video course, you’ll learn how to:

  • Raise exceptions in Python using the raise statement
  • Decide which exceptions to raise and when to raise them in your code
  • Explore common use cases for raising exceptions in Python
  • Apply best practices for raising exceptions in your Python code

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Matt Glaman: Writing tests first saves time and money later on

Planet Drupal - Tue, 2024-04-16 09:18

The TalkingDrupal podcast had Alexey Korepov on to talk about Test Driven Development. Alexey has written the Test Helpers module, a development package that provides many useful utility tools for writing unit tests for your Drupal code.

Categories: FLOSS Project Planets

Balint Pekker: Enhancing Drupal with GitHub Actions

Planet Drupal - Tue, 2024-04-16 06:49
When it comes to Drupal development, GitHub Actions offers invaluable assistance in automating repetitive tasks, standardizing your processes, and enhancing code quality. By defining workflows as code in YAML files that can react to various events, it provides flexible customization and scalability. Pre-built actions can handle common tasks like building and testing code, while custom actions can be tailored to project-specific requirements. Let's explore some of the best practices along with examples of actions you could use in your next Drupal project.
Categories: FLOSS Project Planets

Talk Python to Me: #456: Building GPT Actions with FastAPI and Pydantic

Planet Python - Tue, 2024-04-16 04:00
Do you know what custom GPTs are? They're configurable and shareable chat experiences with a name, logo, custom instructions, conversation starters, access to OpenAI tools, and custom API actions. And, you can build them with Python! Ian Maurer has been doing just that and is here to share his experience building them.<br/> <br/> <strong>Episode sponsors</strong><br/> <br/> <a href='https://talkpython.fm/sentry'>Sentry Error Monitoring, Code TALKPYTHON</a><br> <a href='https://talkpython.fm/neo4j-notes'>Neo4j</a><br> <a href='https://talkpython.fm/training'>Talk Python Courses</a><br/> <br/> <strong>Links from the show</strong><br/> <br/> <div><b>Ian on Twitter</b>: <a href="https://twitter.com/imaurer" target="_blank" rel="noopener">@imaurer</a><br/> <br/> <b>Mobile Navigation</b>: <a href="https://openai.com/blog/introducing-gpts" target="_blank" rel="noopener">openai.com</a><br/> <b>What is a Custom GPT?</b>: <a href="https://www.imaurer.com/what-is-a-custom-gpt/" target="_blank" rel="noopener">imaurer.com</a><br/> <b>Mobile Navigation</b>: <a href="https://openai.com/blog/introducing-the-gpt-store" target="_blank" rel="noopener">openai.com</a><br/> <b>FuzzTypes: Pydantic library for auto-correcting types</b>: <a href="https://github.com/genomoncology/FuzzTypes" target="_blank" rel="noopener">github.com</a><br/> <b>pypi-gpt</b>: <a href="https://github.com/imaurer/pypi-gpt" target="_blank" rel="noopener">github.com</a><br/> <b>marvin</b>: <a href="https://github.com/prefecthq/marvin" target="_blank" rel="noopener">github.com</a><br/> <b>instructor</b>: <a href="https://github.com/jxnl/instructor" target="_blank" rel="noopener">github.com</a><br/> <b>outlines</b>: <a href="https://github.com/outlines-dev/outlines" target="_blank" rel="noopener">github.com</a><br/> <b>llamafile</b>: <a href="https://github.com/Mozilla-Ocho/llamafile" target="_blank" rel="noopener">github.com</a><br/> <b>llama-cpp-python</b>: <a href="https://github.com/abetlen/llama-cpp-python" target="_blank" rel="noopener">github.com</a><br/> <b>LLM Dataset</b>: <a href="https://llm.datasette.io/en/stable/index.html" target="_blank" rel="noopener">llm.datasette.io</a><br/> <b>Plugin directory</b>: <a href="https://llm.datasette.io/en/stable/plugins/directory.html" target="_blank" rel="noopener">llm.datasette.io</a><br/> <b>Data exploration at your fingertips.</b>: <a href="https://www.visidata.org/" target="_blank" rel="noopener">visidata.org</a><br/> <b>hottest new programming language is English</b>: <a href="https://twitter.com/karpathy/status/1617979122625712128" target="_blank" rel="noopener">twitter.com</a><br/> <b>OpenAI & other LLM API Pricing Calculator</b>: <a href="https://docsbot.ai/tools/gpt-openai-api-pricing-calculator" target="_blank" rel="noopener">docsbot.ai</a><br/> <b>Vector DB Comparison</b>: <a href="https://vdbs.superlinked.com/" target="_blank" rel="noopener">vdbs.superlinked.com</a><br/> <b>bpytop</b>: <a href="https://github.com/aristocratos/bpytop" target="_blank" rel="noopener">github.com</a><br/> <b>Source Graph</b>: <a href="https://about.sourcegraph.com/cody" target="_blank" rel="noopener">about.sourcegraph.com</a><br/> <b>Watch this episode on YouTube</b>: <a href="https://www.youtube.com/watch?v=FwmbJiKdAG0" target="_blank" rel="noopener">youtube.com</a><br/> <b>Episode transcripts</b>: <a href="https://talkpython.fm/episodes/transcript/456/building-gpt-actions-with-fastapi-and-pydantic" target="_blank" rel="noopener">talkpython.fm</a><br/> <br/> <b>--- Stay in touch with us ---</b><br/> <b>Subscribe to us on YouTube</b>: <a href="https://talkpython.fm/youtube" target="_blank" rel="noopener">youtube.com</a><br/> <b>Follow Talk Python on Mastodon</b>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>talkpython</a><br/> <b>Follow Michael on Mastodon</b>: <a href="https://fosstodon.org/web/@mkennedy" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div>
Categories: FLOSS Project Planets

Python Bytes: #379 Constable on the debugging case

Planet Python - Tue, 2024-04-16 04:00
<strong>Topics covered in this episode:</strong><br> <ul> <li><a href="https://stefaniemolin.com/articles/devx/pre-commit/setup-guide/">How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project</a>.</li> <li><a href="https://difftastic.wilfred.me.uk"><strong>difftastic</strong></a></li> <li><a href="https://quarto.org"><strong>Quarto</strong></a></li> <li><a href="https://github.com/saurabh0719/constable"><strong>constable</strong></a></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=4PoBtLFRWGU' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="379">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@mkennedy@fosstodon.org</strong></a></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@brianokken@fosstodon.org</strong></a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes"><strong>@pythonbytes@fosstodon.org</strong></a></li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.</p> <p>Finally, if you want an artisanal, hand-crafted digest of every week of </p> <p>the show notes in email form? Add your name and email to <a href="https://pythonbytes.fm/friends-of-the-show">our friends of the show list</a>, we'll never share it.</p> <p><strong>Michael #1:</strong> <a href="https://stefaniemolin.com/articles/devx/pre-commit/setup-guide/">How to Set Up Pre-Commit Hooks A step-by-step guide to installing and configuring pre-commit hooks on your project</a>.</p> <ul> <li>by <a href="https://stefaniemolin.com/"><strong>Stefanie Molin</strong></a></li> <li>Pre-commit hooks are code checks that run as part of the “pre-commit” stage of the git commit process. </li> <li>If any of these checks fail, git aborts the commit</li> <li>Sometimes, we need to bypass the hooks temporarily. For these instances, we can pass the --no-verify option when we run git commit</li> </ul> <p><strong>Brian #2:</strong> <a href="https://difftastic.wilfred.me.uk"><strong>difftastic</strong></a></p> <ul> <li>Found this a couple years ago, but really using it a lot now.</li> <li>Excellent structurally diff tool that compares code based on syntax, not line by line.</li> </ul> <p><strong>Michael #3:</strong> <a href="https://quarto.org"><strong>Quarto</strong></a></p> <ul> <li>via Mathias Johansson</li> <li>An open-source scientific and technical publishing system</li> <li>Transforming a notebook into a pdf / HTML / MS Word / ePub with minimal effort, or even all formats at once.</li> <li>Author using <a href="https://jupyter.org/">Jupyter</a> notebooks or with plain text markdown in your favorite editor.</li> <li>Write using <a href="https://pandoc.org/">Pandoc</a> markdown, including equations, citations, crossrefs, figure panels, callouts, advanced layout, and more.</li> </ul> <p><strong>Brian #4:</strong> <a href="https://github.com/saurabh0719/constable"><strong>constable</strong></a></p> <ul> <li>“inserts print statements directly into the AST at runtime “</li> <li>“If you find yourself aimlessly adding print statements while debugging your code, this is for you. !”</li> <li>Add decorators like @constable.trace('a', 'b') to functions and you’ll get nice output showing when and how a and b changed.</li> <li>see also <a href="https://github.com/gruns/icecream">icecream</a> for another fun debugging with print project.</li> </ul> <p><strong>Extras</strong> </p> <p>Brian:</p> <ul> <li><a href="https://www.reddit.com/r/Python/comments/1bt7rnw/pointerspy_being_added_to_the_standard_library/"><strong>pointers being added to the standard library</strong></a> <ul> <li>A couple weeks old, but still worth covering</li> <li>Guido’s take on adding this, "Why the hell not?"</li> </ul></li> </ul> <p>Michael:</p> <ul> <li><a href="https://docs.python.org/release/3.12.3/whatsnew/changelog.html#python-3-12-2">Python 3.12.3 is out</a></li> </ul> <p><strong>Joke:</strong> <a href="https://twitter.com/hynek/status/1777377316269883420">Hugo SciFi Award</a></p>
Categories: FLOSS Project Planets

Volker Krause - Secure HTTP Usage - Akademy 2019

Planet KDE - Tue, 2024-04-16 02:23

For protecting the privacy of our users and the security and integrity of their systems, usage of transport encryption and authentication is crucial for any network communication. HTTP over TLS (HTTPS) is probably the most widespread set of protocols for that. What do we need to look out for when using this in our applications?

Categories: FLOSS Project Planets

Akademy 2024: Registration Now Open

Planet KDE - Tue, 2024-04-16 02:12

Akademy 2024 will be a hybrid event held simultaneously in Würzburg, Germany, and Online.

Hundreds of participants from the global KDE community, the wider free and open source software community, local organisations and software companies will gather at this year's Akademy 2024 conference. The event will take place in Würzburg and Online from Saturday 7th September to Thursday 12th September.

KDE developers, artists, designers, translators, users, writers, sponsors and supporters from around the world will meet face-to-face to discuss key technology issues, explore new ideas and strengthen KDE's innovative and dynamic culture.

Register now and join us for engaging talks, workshops, BoFs and coding sessions. Collaborate with your fellow KDE contributors to fix bugs, pioneer new features and immerse yourself in the world of open source.

For more information about the conference, visit the Akademy 2024 website.

Categories: FLOSS Project Planets

Specbee: How to integrate Auth0 Single Sign-On (SSO) in Drupal

Planet Drupal - Tue, 2024-04-16 02:09
If you want to offer your users a hassle-free login experience, convenience and security, Single Sign-On (SSO) is the way to go. SSO is an authentication process that allows users to access multiple applications or services with a single set of login credentials. Auth0 is an identity-as-a-service (IDaaS) platform that provides authentication and authorization services for applications and APIs. It offers a comprehensive set of features for implementing secure and customizable authentication solutions, including support for various authentication methods such as username/password, social logins, and multi-factor authentication (MFA). In this article, you will learn more about SSO and Auth0 and how you can integrate it with your Drupal website. Benefits of SSO Integration in Drupal Seamless User Experience: Integrating SSO into Drupal enables users to log in once and access all connected applications seamlessly, eliminating the need for multiple logins and enhancing user convenience. Centralized User Management: SSO centralizes user authentication and authorization, making it easier for administrators to manage user accounts, permissions, and access control policies across multiple Drupal sites or integrated applications. Enhanced Security: SSO enhances security by enforcing consistent authentication policies and enabling centralized management of user access, reducing the risk of security breaches due to weak passwords or unauthorized access. Reduced Development Efforts: By leveraging Auth0's SSO capabilities, developers can significantly reduce the time and effort required to implement authentication and authorization features in Drupal applications, accelerating the development process and time-to-market for new features and functionalities. Take a look at this article where we discussed integration of SSO with Drupal using SAML Steps to Integrate Auth0 SSO in Drupal Prerequisites Auth0 account SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider  Auth0 configuration Register to Auth0. Go to https://manage.auth0.com/ and log in. Create the tenant. To create a tenant, click on the drop-down near the logo in the top left corner. You will see a pop-up fill the required information in that pop-up like tenant name, region, and environment. Click on the Create button. Next, click on the "Applications" option in the left menu. A list will open. Then click on “Applications” on that list and you will see an application page. Click on the “Create Application” button. You will see a pop-up, enter the application name in that pop-up and select “Regular Web Application” then click on Create. Next, click on that application and go to the settings tab. In the Settings tab, you can update the application logo if you want.  In the Settings tab, add the callback URL "[Domain]/samlassertion" to the "Allowed Callback URLs" field and then click Save. Then go to the “Addons Tab”. In the Addons tab, click on the "SAML2 Web App" option. You will see a pop-up with two (Settings and Usage) tabs. In the Settings tab, add the callback URL "[Domain]/samlassertion" and click the Enable button. After this go to the Usage tab. In the Usage tab, click on the "Download" button of "Identity Provider Metadata". Drupal application configuration Install the "SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider" contrib module “https://www.drupal.org/project/miniorange_saml” in your Drupal application using composer.composer require 'drupal/miniorange_saml:^3.0' Go to the Drupal website and log in as administrator. Go to "Configuration" and then click on "MiniOrange SAML Login Configuration". Go to the “Service Provider Setup” tab Click "Add New IDP". Upload the metadata file that we downloaded from Auth0. Click on the save button. Steps to add role mapping Go to “Configuration” then click on "miniOrange SAML Login Configuration". Go to the “MAPPING” tab Click on the “Enable Role Mapping” option (If not enabled already). Select the “Library” role from the dropdown. Click on the “Save Configuration”. Then clear the cache and visit the login page.You will see an SSO login link above the submit button. Click on that link. You will be redirected to the auth0 login page If you have an Auth0 account then enter the username and password otherwise you can create an account using the signup link. After login you will be redirected to your Drupal application and your account will be logged in. Final thoughts The demand for seamless user experiences and robust security measures continues to escalate by the day. By integrating Auth0's Single Sign-On solution with your Drupal site, you're not just staying ahead of the curve — you're shaping the future of online interaction. But the journey doesn't end with integration. The next step is optimization. Continuously refine your authentication workflows, leverage Auth0's advanced features to customize user experiences, and stay vigilant against emerging threats. Reach out to our Drupal development team to enhance your user experience with features like these.
Categories: FLOSS Project Planets

The Drop Times: Christoph Weber to Explore Private LLMs for Technical Documentation at LagoonCon 2024

Planet Drupal - Tue, 2024-04-16 01:59
Join Christoph Weber at LagoonCon Portland on May 6 as he discusses utilizing private large language models to enhance developer access to technical documentation, ensuring data sovereignty with the Lagoon open-source platform. Learn how this integration protects customer data while advancing AI innovation.
Categories: FLOSS Project Planets

The Drop Times: A Detailed Review of Droopler 4 with Grzegorz Bartman of Droptica

Planet Drupal - Tue, 2024-04-16 01:50
Embark on a comprehensive exploration of Droopler 4 as Grzegorz Bartman, the co-CEO of Droptica, unveils the evolutionary strides of this cutting-edge Drupal distribution in an interview with Alka Elizabeth from The DropTimes. Delve into the seamless integration of single directory components, Bootstrap 5, and the Radix theme, tailored to meet the needs of developers. Discover the user-centric design featuring 15 pre-configured components through Drupal paragraphs, responsive web elements, and robust SEO modules catering to marketing and SEO experts. Gain insights into the strategic choices driving the adoption of Drupal Paragraphs over the Layout Builder and the collaborative ethos propelling Droopler's advancement. Stay tuned to the promising future of Droopler, characterized by a steadfast commitment to SEO optimization and enhanced editor experiences.
Categories: FLOSS Project Planets

Volker Krause - KDE Frameworks on Android - Akademy 2019

Planet KDE - Tue, 2024-04-16 00:37

Targeting Android as a platform is attractive for our applications, both as a intermediate proving ground for Plasma Mobile, and due to the large market share. For new Kirigami-based applications that is a fairly straightforward process thanks to the portability of Qt. There is however also lots of valuable code predating mobile UI considerations, and functional gaps in Qt, which is where KDE Frameworks can help. What do we have already, what still needs to be done, and how can we do it?

Categories: FLOSS Project Planets

Katarina Behrens - Look Its LibreOffice on KDE Plasma Software - Akademy 2019

Planet KDE - Mon, 2024-04-15 21:59

This talk introduces LibreOffice's new Qt5-based KDE frontend because at the end of the day, the best free and open-source office suite deservers to be well-integrated into the best free and open-source desktop environment 😃

Categories: FLOSS Project Planets

Dan Leinir Turthra Jensen - Get Hot New Stuff Quick(ly) - Akademy 2019

Planet KDE - Mon, 2024-04-15 20:10

Get an introduction to the Qt Quick based KNewStuff components, the context of why they exist, and find out how you can use them in your own applications.

Categories: FLOSS Project Planets

KDE Plasma 6.0.4, Bugfix Release for April

Planet KDE - Mon, 2024-04-15 20:00

Tuesday, 16 April 2024. Today KDE releases a bugfix update to KDE Plasma 6, versioned 6.0.4.

This release adds three weeks' worth of new translations and fixes from KDE's contributors. The bugfixes are typically small but important and include:

  • Foldermodel: Export urls to the Desktop Portal on drag and copy. Commit.
  • System Monitor: Fix the column configuration dialog being too small on the overview page. Commit. Fixes bug #482008
  • Applets/battery: Check actual battery for charge state workaround. Commit.
View full changelog
Categories: FLOSS Project Planets

Trung Thanh Dinh - AI Face Recognition with OpenCV in digiKam - Akademy 2019

Planet KDE - Mon, 2024-04-15 18:24

Currently, we are observing an incredible development in technologies, especially in Artificial Intelligence field. Indeed, by learning from massive data, AI is particularly good at some tasks that normal algorithms cannot achieve as good level of performance, such as: image classification, speech recognition, object detection, tendency prediction, feature extraction, etc. Moreover, new AI algorithms with the emergence of neural networks and deep learning even makes AI models more robust, so that they can now give better prediction without any limitation in improving themselves.

Being aware of those assets, digiKam team has considered using deep learning in digiKam. Thus, this presentation aims to introduce a new implementation of facial recognition in digiKam, based on deep learning models and OpenCV DNN module, so as to improve the performance of facial recognition module.

Categories: FLOSS Project Planets

Ivana Isadora Devcic - Why Your Community Needs a Developer Portal - Akademy 2019

Planet KDE - Mon, 2024-04-15 17:24

How can a community like KDE benefit from a developer portal...and what is a developer portal, anyway? This talk aims to answer those questions, and offers practical advice for building a developer portal. The insights from this session can serve as guidance and inspiration to all contributors who want to make sure their community keeps growing and thriving.

Categories: FLOSS Project Planets

The Drop Times: Embracing Technology with Drupal

Planet Drupal - Mon, 2024-04-15 16:24

In 2024, technology has reached new heights, impacting our lives like never before. With AI becoming more common and exciting updates on the horizon, technology is shaping our world significantly.

Technology continues to redefine the way we live, work, and connect. New features, updates, and innovations emerge daily, shaping our world remarkably. At the heart of this transformation lies Drupal, the dynamic content management system that empowers individuals and businesses to navigate the digital realm easily and confidently. Drupal opens limitless possibilities in website development, offering a platform where creativity knows no bounds.

Drupal streamlines the process of creating and managing websites, putting the power of customization and control at our fingertips. With its intuitive interface and robust features, Drupal allows users to craft online experiences that are not just functional but truly exceptional.

Technology is advancing rapidly, and Drupal is here to make it accessible and beneficial for everyone. With its user-friendly features and adaptability, Drupal simplifies website creation and opens doors to endless possibilities.

Let's review the latest news covered by The Drop Times (TDT) last week.

In an Interview with Alka Elizabeth, sub-editor, TDT, Irina Zaks, Co-Founder and CTO at Fibonacci Web Studio, discusses her transition from a background in physics to web development, emphasizing the importance of clear, simple solutions in complex projects. She highlights the Fibonacci sequence's role in her design philosophy, advocating for harmony and simplicity in web development. Zaks also reflects on the unique challenges of academic websites and her efforts to promote open-source software within academia, particularly through her work at the Stanford Open Source Lab. The interview is a precursor to Stanford Web Camp. 

Head to the concluding part of our series, "Drupal Page Builders—Part 4: Distributions," crafted by André Angelantoni, Senior Drupal Architect, HeroDevs. The article discusses the practicalities and considerations of using Drupal distributions for page building. It emphasizes that while distributions can simplify the setup process, especially for non-technical users, they often involve complex maintenance and may slow down upgrades due to dependency on the distribution maintainers. The piece advises conducting a proof-of-concept for the most complex page layouts to ensure the chosen solution can handle the requirements, highlighting that many teams opt for minimal module use to maintain flexibility and control.

Explore the articles curated by Kazima Abbas regarding the featured speakers who presented their sessions at EvolveDrupal Atlanta. The first part features Michael Herchel, Mary Blabaum, Allison Vorthmann, Andy Waldrop, and Jesse Dyck.  Topics range from an Inclusive Design Approach to Drupal 7's End of Life on website security and from leveraging Drupal for scalable software products to insights on migrating to Drupal 10. The second part shifts to topics including The Fourth Decade of Website Deployments, the Crossroads of Website Evolution, and the updates from WCAG 2.1 to 2.2. John Cloys, Penny Kronz, and Steve Persch are featured in this segment. 

The upcoming Drupal Developer Days in Burgas, Bulgaria, from June 26-28, 2024, at Burgas Free University, has announced Suzanne Dergacheva and Frederik W. as keynote speakers. DrupalCamp Iberia 2024 has officially announced its schedule for the upcoming gathering on May 10 and 11 at PACT in Évora, marking a significant event in the Drupal community's annual calendar. The Network of European Drupal Associations (NEDA) has scheduled a meeting on April 24, 2024, led by Esmeralda Tijhoff. This meeting aims to foster connections among Drupal Associations globally, sharing experiences and discussing support strategies.

DrupalCon Portland 2024 extends a special offer to students, recent graduates, and individuals with Drupal Training Certification obtained since 2022, providing an opportunity to purchase tickets for the event at a discounted rate of $50. The DropTimes has been announced as the official media partner for The LagoonCon Portland 2024. DrupalSouth has made their talks from DrupalSouth 2024 accessible online via their YouTube channel! Now, you can catch up on all the insightful discussions and presentations from the comfort of your home. A particularly engaging story narrated at the event is the talk by Dallas Ramsden, a story of human resilience. The Eclipse Foundation has initiated a collaborative effort to establish common cybersecurity standards in response to the upcoming European Union's Cyber Resilience Act. This initiative involves multiple open-source organizations and aims to harmonize secure software development practices across the industry, addressing both regulatory requirements and the broader challenge of securing open-source software. The Greek Drupal Community celebrated a resurgence with the Greece Spring Sprint 2024, where experienced developers across Athens, Thessaloniki, and Patras collaborated to address numerous issues. We have received pictures via Georgios Andreadis of the event, take a look here.

Jesus Manuel Olivas, Co-Founder and CEO at Octahedroid, announced the initial release of two significant Drupal modules—Visual Editor and Decoupled Preview Iframe. A recent update from Drupal.org saw Gábor Hojtsy outlining the forthcoming release plans for Drupal 11, noting significant dependency updates and two potential release windows later this year. Obviously, this has created discussions in the community. Paul Johnson, a long-time participant and photographer at Drupal events, has announced an initiative by the Promote Drupal team to create the first official Promote Drupal Image Library. The team calls for submissions from photographers within the Drupal community who are willing to contribute their work under a Creative Commons license. 

While there are undoubtedly more stories to share, our current constraints may necessitate a temporary pause in our coverage.

To get timely updates, follow us on LinkedIn, Twitter and Facebook. Also, join us on Drupal Slack at #thedroptimes.

Thank you,
Kazima Abbas
Sub-editor, The Drop Times

Categories: FLOSS Project Planets

Ned Batchelder: Try it: function/class coverage report

Planet Python - Mon, 2024-04-15 16:02

I’ve added experimental function and class coverage reports to coverage.py. I’d like feedback about whether they behave the way you want them to.

I haven’t made a PyPI release. To try the new reports, install coverage from GitHub. Be sure to include the hash:

$ python3 -m pip install git+https://github.com/nedbat/coveragepy@f10c455b7c8fd26352de#egg=coverage==0.0

Then run coverage and make an HTML report as you usually do. You should have two new pages, not linked from the index page (yet). “htmlcov/function_index.html” is the function coverage report, and the classes are in “htmlcov/class_index.html”.

I had to decide how to categorize nested functions and classes. Inner functions are not counted as part of their outer functions. Classes consist of the executable lines in their methods, but not lines outside of methods, because those lines run on import. Each file has an entry in the function report for all of the lines outside of any function, called “(no function)”. The class report has “(no class)” entries for lines outside of any classes.

The result should be that every line is part of one function, or the “(no function)” entry, and every line is part of one class, or the “(no class)” entry. This is what made sense to me, but maybe there’s a compelling reason to do it differently.

The reports have a sortable column for the file name, and a sortable column for the function or class. Where functions or classes are nested, the name is a dotted sequence, but is sorted by only the last component. Just like the original file listing page, the new pages can be filtered to focus on areas of interest.

You can look at some sample reports:

It would be helpful if you could give me feedback on the original issue about some questions:

  • Is it useful to have “(no function)” and “(no class)” entries or is it just distracting pedantry? With the entries, the total is the same as the file report, but they don’t seem useful by themselves.
  • Does the handling of nested functions and classes make sense?
  • Should these reports be optional (requested with a switch) or always produced?
  • Is it reasonable to produce one page with every function? How large does a project have to get before that’s not feasible or useful?
  • And most importantly: do these reports help you understand how to improve your code?

This is only in the HTML report for now, but we can do more in the future. Other ideas about improvements are of course welcome. Thanks!

Categories: FLOSS Project Planets