diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9ecbd1a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,37 @@ +# Development and build files +.venv/ +.env +.envrc +*.pyc +__pycache__/ +.pytest_cache/ +.coverage +htmlcov/ +.mypy_cache/ +.ruff_cache/ + +# Git +.git/ +.gitignore + +# IDEs +.vscode/ +.idea/ +*.swp +*.swo + +# Documentation builds +docs/_build/ +site/ + +# Temporary files +*.tmp +*.log +.DS_Store +Thumbs.db + +# Local development +examples/data/ +*.local +.cursorignore +.cursorindexingignore \ No newline at end of file diff --git a/.gdpval-config b/.gdpval-config new file mode 100644 index 0000000..9bcae87 --- /dev/null +++ b/.gdpval-config @@ -0,0 +1,20 @@ +# Configuration file for development environment setup +[venv] +path = ".venv" +python_version = "3.11" + +[project] +name = "gdpval-base" +description = "Docker Images and analysis to partially replicate OpenAI's GDPval" + +[scripts] +setup = "./scripts/setup.sh" +test = "./scripts/dev.sh test" +lint = "./scripts/dev.sh lint" +format = "./scripts/dev.sh format" +run = "./scripts/dev.sh run" + +[docker] +image_name = "gdpval-base" +dev_service = "gdpval-base" +prod_service = "gdpval-base-prod" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8fe7410 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +# Use Python 3.11 official image +FROM python:3.11-slim + +# Set environment variables +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 + +# Set work directory +WORKDIR /app + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + && rm -rf /var/lib/apt/lists/* + +# Create virtual environment +RUN python -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" + +# Copy requirements first for better caching +COPY requirements.txt requirements-dev.txt ./ + +# Install Python dependencies +RUN pip install --upgrade pip && \ + pip install -r requirements.txt + +# Copy project files +COPY . . + +# Install the package in development mode +RUN pip install -e . + +# Create a non-root user +RUN useradd --create-home --shell /bin/bash app && \ + chown -R app:app /app /opt/venv +USER app + +# Expose port (if needed for future web services) +EXPOSE 8000 + +# Default command +CMD ["python", "-c", "from gdpval_base import GDPvalAnalyzer; print('GDPval Base package is ready!')"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1dc4e50 --- /dev/null +++ b/Makefile @@ -0,0 +1,59 @@ +.PHONY: help setup test lint format run clean docker-build docker-run docker-dev + +help: ## Show this help message + @echo 'Usage: make [target]' + @echo '' + @echo 'Targets:' + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST) + +setup: ## Set up development environment + @echo "Setting up development environment..." + ./scripts/setup.sh + +test: ## Run tests with coverage + @echo "Running tests..." + ./scripts/dev.sh test + +lint: ## Run linting checks + @echo "Running linting checks..." + ./scripts/dev.sh lint + +format: ## Format code + @echo "Formatting code..." + ./scripts/dev.sh format + +run: ## Run the package + @echo "Running package..." + ./scripts/dev.sh run + +clean: ## Clean up generated files + @echo "Cleaning up..." + rm -rf .venv/ + rm -rf build/ + rm -rf dist/ + rm -rf *.egg-info/ + rm -rf .pytest_cache/ + rm -rf htmlcov/ + rm -rf .coverage + find . -type d -name __pycache__ -exec rm -rf {} + + find . -type f -name "*.pyc" -delete + +docker-build: ## Build Docker image + @echo "Building Docker image..." + docker build -t gdpval-base . + +docker-run: docker-build ## Run Docker container + @echo "Running Docker container..." + docker run -it gdpval-base + +docker-dev: ## Start development environment with Docker Compose + @echo "Starting development environment..." + docker-compose up gdpval-base + +install: ## Install package in current environment + @echo "Installing package..." + pip install -e . + +install-dev: ## Install package with development dependencies + @echo "Installing package with development dependencies..." + pip install -e .[dev] \ No newline at end of file diff --git a/README.md b/README.md index fdbfc97..b99152c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,240 @@ # GDPval-base -Docker Images and analysis to partially replicate OpenAI's https://openai.com/index/gdpval/ + +Docker Images and analysis to partially replicate OpenAI's [GDPval](https://openai.com/index/gdpval/). + +A Python package built with Python 3.11.* that uses Docker and pip + venv package managers for analyzing GDP data and performing related operations. + +## Features + +- **Python 3.11 Support**: Built specifically for Python 3.11.* +- **Docker Integration**: Full Docker support with development and production configurations +- **Virtual Environment Management**: Scripts for easy venv setup and management +- **Comprehensive Testing**: Test suite with pytest and coverage reporting +- **Code Quality**: Integrated linting with black, isort, flake8, and mypy +- **Modular Design**: Clean, extensible package structure + +## Quick Start + +### Prerequisites + +- Python 3.11.* +- Docker (optional) +- Git + +### Option 1: Local Development with Virtual Environment + +1. **Clone the repository:** + ```bash + git clone https://github.com/closedloop-technologies/GDPval-base.git + cd GDPval-base + ``` + +2. **Set up the development environment:** + ```bash + ./scripts/setup.sh + ``` + +3. **Activate the virtual environment:** + ```bash + source .venv/bin/activate + ``` + +4. **Run the package:** + ```bash + ./scripts/dev.sh run + ``` + +### Option 2: Docker Development + +1. **Clone the repository:** + ```bash + git clone https://github.com/closedloop-technologies/GDPval-base.git + cd GDPval-base + ``` + +2. **Build and run with Docker Compose:** + ```bash + # Development mode with interactive shell + docker-compose up gdpval-base + + # Production mode + docker-compose up gdpval-base-prod + ``` + +3. **Or build and run with Docker directly:** + ```bash + docker build -t gdpval-base . + docker run -it gdpval-base + ``` + +## Usage + +### Basic Usage + +```python +from gdpval_base import GDPvalAnalyzer + +# Initialize the analyzer +analyzer = GDPvalAnalyzer() + +# Load data from a CSV file +success = analyzer.load_data("path/to/your/data.csv") + +if success: + # Perform analysis + results = analyzer.analyze() + print(results) +``` + +### With Configuration + +```python +from gdpval_base import GDPvalAnalyzer + +# Initialize with custom configuration +config = { + "analysis_type": "advanced", + "output_format": "detailed" +} +analyzer = GDPvalAnalyzer(config) + +# Use the analyzer... +``` + +## Development + +### Development Scripts + +The repository includes convenient development scripts: + +```bash +# Run tests with coverage +./scripts/dev.sh test + +# Run linting checks +./scripts/dev.sh lint + +# Format code +./scripts/dev.sh format + +# Run the package +./scripts/dev.sh run +``` + +### Package Structure + +``` +GDPval-base/ +├── src/ +│ └── gdpval_base/ +│ ├── __init__.py +│ └── core.py +├── tests/ +│ ├── __init__.py +│ ├── test_core.py +│ └── test_package.py +├── scripts/ +│ ├── setup.sh +│ └── dev.sh +├── Dockerfile +├── docker-compose.yml +├── pyproject.toml +├── requirements.txt +├── requirements-dev.txt +└── README.md +``` + +### Testing + +Run the test suite: + +```bash +# With the development script +./scripts/dev.sh test + +# Or directly with pytest +pytest tests/ -v --cov=src/gdpval_base --cov-report=html +``` + +### Code Quality + +The project includes several code quality tools: + +- **Black**: Code formatting +- **isort**: Import sorting +- **flake8**: Linting +- **mypy**: Type checking + +Run all checks: + +```bash +./scripts/dev.sh lint +``` + +Format code: + +```bash +./scripts/dev.sh format +``` + +## Docker + +### Development with Docker + +```bash +# Build the image +docker build -t gdpval-base . + +# Run interactively +docker run -it -v $(pwd):/app gdpval-base /bin/bash + +# Run with docker-compose for development +docker-compose up gdpval-base +``` + +### Production Deployment + +```bash +# Run in production mode +docker-compose up gdpval-base-prod + +# Or with Docker directly +docker run gdpval-base +``` + +## Package Management + +This project uses multiple package management approaches: + +1. **pip + venv**: Traditional Python package management with virtual environments +2. **Docker**: Containerized dependencies and runtime environment +3. **pyproject.toml**: Modern Python packaging standards + +### Installing Dependencies + +```bash +# Development dependencies +pip install -r requirements-dev.txt + +# Production dependencies only +pip install -r requirements.txt + +# Install in editable mode +pip install -e . +``` + +## Contributing + +1. Fork the repository +2. Create a feature branch +3. Make your changes +4. Run tests and linting: `./scripts/dev.sh test && ./scripts/dev.sh lint` +5. Submit a pull request + +## License + +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. + +## Related Work + +This project aims to partially replicate OpenAI's [GDPval](https://openai.com/index/gdpval/) functionality for GDP data analysis and validation. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..af9cdf1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: '3.8' + +services: + gdpval-base: + build: + context: . + dockerfile: Dockerfile + container_name: gdpval-base-dev + volumes: + - .:/app + - gdpval-venv:/opt/venv + environment: + - PYTHONPATH=/app/src + ports: + - "8000:8000" + stdin_open: true + tty: true + command: /bin/bash + + gdpval-base-prod: + build: + context: . + dockerfile: Dockerfile + container_name: gdpval-base-prod + environment: + - PYTHONPATH=/app/src + ports: + - "8001:8000" + +volumes: + gdpval-venv: \ No newline at end of file diff --git a/examples/demo.py b/examples/demo.py new file mode 100644 index 0000000..9d4926d --- /dev/null +++ b/examples/demo.py @@ -0,0 +1,78 @@ +# Example usage script for GDPval Base package + +from gdpval_base import GDPvalAnalyzer +import pandas as pd +import tempfile +import os + +def demo_basic_usage(): + """Demonstrate basic usage of the GDPval analyzer.""" + print("=== GDPval Base Package Demo ===") + + # Initialize the analyzer + analyzer = GDPvalAnalyzer() + print(f"Initialized GDPval Analyzer v{analyzer.get_version()}") + + # Create sample GDP data + sample_data = { + 'country': ['United States', 'China', 'Japan', 'Germany', 'United Kingdom'], + 'gdp_trillions': [21.43, 14.34, 4.94, 3.85, 2.83], + 'year': [2020, 2020, 2020, 2020, 2020], + 'population_millions': [331, 1439, 126, 83, 67] + } + + # Create a temporary CSV file + df = pd.DataFrame(sample_data) + with tempfile.NamedTemporaryFile(mode='w', suffix='.csv', delete=False) as tmp_file: + df.to_csv(tmp_file.name, index=False) + temp_csv_path = tmp_file.name + + try: + # Load data from CSV + print("\nLoading sample GDP data...") + success = analyzer.load_data(temp_csv_path) + + if success: + print("✓ Data loaded successfully!") + + # Perform analysis + print("\nPerforming analysis...") + results = analyzer.analyze() + + print(f"Total countries: {results['total_rows']}") + print(f"Data columns: {', '.join(results['columns'])}") + + if results['summary_stats']: + print("\nSummary statistics for numerical columns:") + for col, stats in results['summary_stats'].items(): + if 'mean' in stats: + print(f" {col}: mean = {stats['mean']:.2f}") + + print("\nNull value counts:") + for col, null_count in results['null_counts'].items(): + print(f" {col}: {null_count} null values") + else: + print("✗ Failed to load data") + + finally: + # Clean up temporary file + if os.path.exists(temp_csv_path): + os.unlink(temp_csv_path) + +def demo_with_config(): + """Demonstrate usage with custom configuration.""" + print("\n=== Demo with Custom Configuration ===") + + config = { + 'analysis_mode': 'detailed', + 'include_validation': True, + 'output_format': 'verbose' + } + + analyzer = GDPvalAnalyzer(config) + print(f"Analyzer initialized with config: {analyzer.config}") + +if __name__ == "__main__": + demo_basic_usage() + demo_with_config() + print("\n=== Demo Complete ===") \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3dfc60a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "gdpval-base" +version = "0.1.0" +description = "Docker Images and analysis to partially replicate OpenAI's GDPval" +readme = "README.md" +license = {text = "Apache-2.0"} +authors = [ + {name = "Closedloop Technologies", email = "info@closedloop.tech"}, +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.11" +dependencies = [ + "requests>=2.31.0", + "numpy>=1.24.0", + "pandas>=2.0.0", +] + +[project.optional-dependencies] +dev = [ + "pytest>=7.0.0", + "pytest-cov>=4.0.0", + "black>=23.0.0", + "isort>=5.12.0", + "flake8>=6.0.0", + "mypy>=1.0.0", +] + +[project.urls] +Homepage = "https://github.com/closedloop-technologies/GDPval-base" +"Bug Reports" = "https://github.com/closedloop-technologies/GDPval-base/issues" +"Source" = "https://github.com/closedloop-technologies/GDPval-base" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-dir] +"" = "src" + +[tool.black] +line-length = 88 +target-version = ['py311'] + +[tool.isort] +profile = "black" +line_length = 88 + +[tool.mypy] +python_version = "3.11" +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = true + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = ["test_*.py"] +python_classes = ["Test*"] +python_functions = ["test_*"] \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..1a7efa2 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,16 @@ +# Development dependencies +-r requirements.txt + +# Testing +pytest>=7.0.0 +pytest-cov>=4.0.0 + +# Code formatting and linting +black>=23.0.0 +isort>=5.12.0 +flake8>=6.0.0 +mypy>=1.0.0 + +# Documentation +sphinx>=7.0.0 +sphinx-rtd-theme>=1.3.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..26c5883 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +# Core dependencies +requests>=2.31.0 +numpy>=1.24.0 +pandas>=2.0.0 \ No newline at end of file diff --git a/scripts/dev.sh b/scripts/dev.sh new file mode 100755 index 0000000..087859f --- /dev/null +++ b/scripts/dev.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# Development script for running common tasks + +set -e + +VENV_DIR=".venv" + +# Function to ensure virtual environment is activated +ensure_venv() { + if [[ "$VIRTUAL_ENV" == "" ]]; then + if [ -d "$VENV_DIR" ]; then + echo "Activating virtual environment..." + source $VENV_DIR/bin/activate + else + echo "Virtual environment not found. Run './scripts/setup.sh' first." + exit 1 + fi + fi +} + +# Function to run tests +run_tests() { + ensure_venv + echo "Running tests..." + pytest tests/ -v --cov=src/gdpval_base --cov-report=html +} + +# Function to run linting +run_lint() { + ensure_venv + echo "Running linting..." + echo "Running black..." + black src/ tests/ --check --diff + echo "Running isort..." + isort src/ tests/ --check-only --diff + echo "Running flake8..." + flake8 src/ tests/ + echo "Running mypy..." + mypy src/ +} + +# Function to format code +format_code() { + ensure_venv + echo "Formatting code..." + black src/ tests/ + isort src/ tests/ +} + +# Function to run the package +run_package() { + ensure_venv + echo "Running GDPval Base package..." + python -c "from gdpval_base import GDPvalAnalyzer; analyzer = GDPvalAnalyzer(); print(f'GDPval Base v{analyzer.get_version()} is ready!')" +} + +# Main script logic +case "$1" in + "test") + run_tests + ;; + "lint") + run_lint + ;; + "format") + format_code + ;; + "run") + run_package + ;; + *) + echo "Usage: $0 {test|lint|format|run}" + echo " test - Run tests with coverage" + echo " lint - Run linting checks" + echo " format - Format code with black and isort" + echo " run - Run the package" + exit 1 + ;; +esac \ No newline at end of file diff --git a/scripts/setup.sh b/scripts/setup.sh new file mode 100755 index 0000000..ffb02ff --- /dev/null +++ b/scripts/setup.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Setup script for creating and managing virtual environment + +set -e + +VENV_DIR=".venv" +PYTHON_VERSION="3.11" + +echo "Setting up GDPval Base development environment..." + +# Check for Python 3.11, fall back to python3 +if command -v python$PYTHON_VERSION &> /dev/null; then + PYTHON_CMD="python$PYTHON_VERSION" +elif command -v python3 &> /dev/null; then + PYTHON_CMD="python3" + echo "Python 3.11 not found, using $(python3 --version)" +else + echo "No suitable Python version found. Please install Python 3.11+ first." + exit 1 +fi + +# Create virtual environment if it doesn't exist +if [ ! -d "$VENV_DIR" ]; then + echo "Creating virtual environment with $PYTHON_CMD..." + $PYTHON_CMD -m venv $VENV_DIR +else + echo "Virtual environment already exists at $VENV_DIR" +fi + +# Activate virtual environment +echo "Activating virtual environment..." +source $VENV_DIR/bin/activate + +# Upgrade pip +echo "Upgrading pip..." +pip install --upgrade pip + +# Install dependencies +echo "Installing dependencies..." +if [ -f "requirements-dev.txt" ]; then + pip install -r requirements-dev.txt +elif [ -f "requirements.txt" ]; then + pip install -r requirements.txt +fi + +# Install package in development mode +echo "Installing package in development mode..." +pip install -e . + +echo "Setup complete!" +echo "To activate the environment, run: source $VENV_DIR/bin/activate" +echo "To deactivate, run: deactivate" \ No newline at end of file diff --git a/src/gdpval_base/__init__.py b/src/gdpval_base/__init__.py new file mode 100644 index 0000000..89adcd6 --- /dev/null +++ b/src/gdpval_base/__init__.py @@ -0,0 +1,14 @@ +""" +GDPval Base Package + +A Python package for Docker Images and analysis to partially replicate +OpenAI's GDPval. +""" + +__version__ = "0.1.0" +__author__ = "Closedloop Technologies" +__email__ = "info@closedloop.tech" + +from .core import GDPvalAnalyzer + +__all__ = ["GDPvalAnalyzer"] diff --git a/src/gdpval_base/core.py b/src/gdpval_base/core.py new file mode 100644 index 0000000..4ab3bb4 --- /dev/null +++ b/src/gdpval_base/core.py @@ -0,0 +1,85 @@ +""" +Core functionality for GDPval analysis. +""" + +from typing import Any, Dict + +import numpy as np +import pandas as pd +import requests + + +class GDPvalAnalyzer: + """ + Main analyzer class for GDPval operations. + + This class provides the core functionality for analyzing GDP data + and performing related operations similar to OpenAI's GDPval. + """ + + def __init__(self, config: Dict[str, Any] = None): + """ + Initialize the GDPval analyzer. + + Args: + config: Configuration dictionary for the analyzer + """ + self.config = config or {} + self.data: pd.DataFrame = pd.DataFrame() + + def load_data(self, data_source: str) -> bool: + """ + Load data from a given source. + + Args: + data_source: Path or URL to the data source + + Returns: + True if data loaded successfully, False otherwise + """ + try: + if data_source.startswith(("http://", "https://")): + # Load from URL + response = requests.get(data_source) + response.raise_for_status() + # For demonstration, we'll assume CSV data + self.data = pd.read_csv(data_source) + else: + # Load from local file + self.data = pd.read_csv(data_source) + return True + except Exception as e: + print(f"Error loading data: {e}") + return False + + def analyze(self) -> Dict[str, Any]: + """ + Perform GDP analysis on the loaded data. + + Returns: + Dictionary containing analysis results + """ + if self.data.empty: + return {"error": "No data loaded"} + + results = { + "total_rows": len(self.data), + "columns": list(self.data.columns), + "summary_stats": ( + self.data.describe().to_dict() + if len(self.data.select_dtypes(include=[np.number]).columns) > 0 + else {} + ), + "null_counts": self.data.isnull().sum().to_dict(), + } + + return results + + def get_version(self) -> str: + """ + Get the version of the analyzer. + + Returns: + Version string + """ + return "0.1.0" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..7b82c2b --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# Test configuration diff --git a/tests/test_core.py b/tests/test_core.py new file mode 100644 index 0000000..dbd9f79 --- /dev/null +++ b/tests/test_core.py @@ -0,0 +1,78 @@ +""" +Tests for the core GDPval functionality. +""" + +import pandas as pd +import pytest + +from gdpval_base.core import GDPvalAnalyzer + + +class TestGDPvalAnalyzer: + """Test cases for the GDPvalAnalyzer class.""" + + def test_init_default(self): + """Test analyzer initialization with default config.""" + analyzer = GDPvalAnalyzer() + assert analyzer.config == {} + assert analyzer.data.empty + + def test_init_with_config(self): + """Test analyzer initialization with custom config.""" + config = {"key": "value"} + analyzer = GDPvalAnalyzer(config) + assert analyzer.config == config + + def test_get_version(self): + """Test version retrieval.""" + analyzer = GDPvalAnalyzer() + version = analyzer.get_version() + assert version == "0.1.0" + + def test_analyze_empty_data(self): + """Test analysis with no data loaded.""" + analyzer = GDPvalAnalyzer() + result = analyzer.analyze() + assert result == {"error": "No data loaded"} + + def test_analyze_with_data(self): + """Test analysis with sample data.""" + analyzer = GDPvalAnalyzer() + # Create sample data + sample_data = pd.DataFrame( + { + "country": ["USA", "UK", "Japan"], + "gdp": [21.43, 2.83, 4.94], + "year": [2020, 2020, 2020], + } + ) + analyzer.data = sample_data + + result = analyzer.analyze() + + assert result["total_rows"] == 3 + assert set(result["columns"]) == {"country", "gdp", "year"} + assert "summary_stats" in result + assert "null_counts" in result + + def test_load_data_invalid_source(self): + """Test loading data from invalid source.""" + analyzer = GDPvalAnalyzer() + result = analyzer.load_data("nonexistent_file.csv") + assert result is False + + @pytest.fixture + def sample_csv_file(self, tmp_path): + """Create a temporary CSV file for testing.""" + csv_file = tmp_path / "sample.csv" + data = "country,gdp,year\nUSA,21.43,2020\nUK,2.83,2020\n" + csv_file.write_text(data) + return str(csv_file) + + def test_load_data_local_file(self, sample_csv_file): + """Test loading data from local CSV file.""" + analyzer = GDPvalAnalyzer() + result = analyzer.load_data(sample_csv_file) + assert result is True + assert len(analyzer.data) == 2 + assert list(analyzer.data.columns) == ["country", "gdp", "year"] diff --git a/tests/test_package.py b/tests/test_package.py new file mode 100644 index 0000000..3cf01dc --- /dev/null +++ b/tests/test_package.py @@ -0,0 +1,22 @@ +""" +Tests for the package imports and structure. +""" + +import gdpval_base +from gdpval_base import GDPvalAnalyzer + + +def test_package_imports(): + """Test that main package imports work correctly.""" + assert hasattr(gdpval_base, "GDPvalAnalyzer") + assert hasattr(gdpval_base, "__version__") + assert gdpval_base.__version__ == "0.1.0" + + +def test_analyzer_import(): + """Test that the analyzer can be imported directly.""" + analyzer = GDPvalAnalyzer() + assert analyzer is not None + assert hasattr(analyzer, "analyze") + assert hasattr(analyzer, "load_data") + assert hasattr(analyzer, "get_version")